/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * articulos_sie_catalogo.java
 *
 * Created on 8/02/2011, 04:12:32 AM
 */

package sie_invdis;

import java.sql.*;
import javax.swing.*;

import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTable.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Date;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.text.*;
import javax.swing.JFrame;
import java.io.*;
import org.jfree.ui.RefineryUtilities;

/**
 *
 * @author Administrador
 */
public class articulos_sie_catalogo extends javax.swing.JFrame {

    private javax.swing.table.DefaultTableModel jtable_modelo;
    private javax.swing.table.DefaultTableModel jtable_modelo_existencias;
    private javax.swing.table.DefaultTableModel jtable_modelo_etiq;
    private javax.swing.table.DefaultTableModel jtable_modelo2;
    private javax.swing.table.DefaultTableModel jtable_modelop;
    private javax.swing.table.DefaultTableModel jtable_modelo_prosug;
  private javax.swing.table.DefaultTableModel jtable_modelo_detallealmab;
 
    private DefaultListModel modelout,modeloub,modeloubhis;
    private int control_enter=0,controltiendas=0,buscamp=1,opbuscamp=1,indexactual=0,yacarguefotos=0,carguee=0,idc=0,vde=2,controlcombo=0,modoope=1,carguee5=0,controlcombo2=0,almacen=0;
    private bd_conexion x = new bd_conexion() ;
    private String textohtml="";
      //se creaa la variable resultset
    private ResultSet rs = null;
       //llamo almetodo para establecer la conexion
    private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");
    /** Creates new form articulos_sie_catalogo */
    public articulos_sie_catalogo() {
      //  super(parent, modal);
    // x.estableceConexion();
     this.setLocation(5,5);
      //se contrulle el modelo de tabla
     this.iniciar_modelo_de_tabla();
     this.iniciar_modelo_artiexistencias();
     this.iniciar_modelo_etiq();
     this.iniciar_modelo_de_tabla2();
     this.iniciar_modelo_de_tablapromo();
     this.iniciar_modelo_Promosug();

     this.iniciar_modelo_detallealmabod();
       modelout = new javax.swing.DefaultListModel();
       modeloub = new javax.swing.DefaultListModel();
       modeloubhis = new javax.swing.DefaultListModel();
    initComponents();
    //inicio con el boton de clave seleccionado
    this.buttonGroup1.setSelected(jrb_bclave.getModel(), true);
    this.buttonGroup2.setSelected(jrb_obexacto.getModel(), true);
    this.buttonGroup4.setSelected(jrbtn_existencia.getModel(), true);

    this.buttonGroup5.setSelected(jrbtn_modoactualizacion.getModel(), true);

    this.jtf_busqueda.requestFocus();

    jtb_catalogo_articulos.getColumnModel().getColumn(0).setPreferredWidth(40);//tem ent
    jtb_catalogo_articulos.getColumnModel().getColumn(1).setPreferredWidth(40);//Familia
    jtb_catalogo_articulos.getColumnModel().getColumn(2).setPreferredWidth(50);//Subfamilia
    jtb_catalogo_articulos.getColumnModel().getColumn(3).setPreferredWidth(90);//Clave
    jtb_catalogo_articulos.getColumnModel().getColumn(4).setPreferredWidth(140);//Descripcion
    jtb_catalogo_articulos.getColumnModel().getColumn(5).setPreferredWidth(60);//item
    jtb_catalogo_articulos.getColumnModel().getColumn(6).setPreferredWidth(60);//Linea
    jtb_catalogo_articulos.getColumnModel().getColumn(7).setPreferredWidth(20);//Precio
    jtb_catalogo_articulos.getColumnModel().getColumn(8).setPreferredWidth(60);//Fecha
    jtb_catalogo_articulos.getColumnModel().getColumn(9).setPreferredWidth(40);//Acum
    jtb_catalogo_articulos.getColumnModel().getColumn(10).setPreferredWidth(20);//Exist
    jtb_catalogo_articulos.getColumnModel().getColumn(11).setPreferredWidth(20);//% Rotacion

    jtb_catalogo_articulos3.getColumnModel().getColumn(0).setPreferredWidth(40);//tem ent
    jtb_catalogo_articulos3.getColumnModel().getColumn(1).setPreferredWidth(60);//Familia
    jtb_catalogo_articulos3.getColumnModel().getColumn(2).setPreferredWidth(80);//Subfamilia
    jtb_catalogo_articulos3.getColumnModel().getColumn(3).setPreferredWidth(10);//Clave
    jtb_catalogo_articulos3.getColumnModel().getColumn(4).setPreferredWidth(80);//Descripcion
    jtb_catalogo_articulos3.getColumnModel().getColumn(5).setPreferredWidth(10);//item
    jtb_catalogo_articulos3.getColumnModel().getColumn(6).setPreferredWidth(55);//Linea


    jt_catempleados1.getColumnModel().getColumn(0).setPreferredWidth(65);//tem ent
    jt_catempleados1.getColumnModel().getColumn(1).setPreferredWidth(80);//Familia
    jt_catempleados1.getColumnModel().getColumn(2).setPreferredWidth(10);//Subfamilia
    jt_catempleados1.getColumnModel().getColumn(3).setPreferredWidth(50);//Clave
    jt_catempleados1.getColumnModel().getColumn(4).setPreferredWidth(60);//Descripcion


    jtb_catalogo_articulos2.getColumnModel().getColumn(0).setPreferredWidth(40);//tem ent
    jtb_catalogo_articulos2.getColumnModel().getColumn(1).setPreferredWidth(40);//Familia
    jtb_catalogo_articulos2.getColumnModel().getColumn(2).setPreferredWidth(50);//Subfamilia
    jtb_catalogo_articulos2.getColumnModel().getColumn(3).setPreferredWidth(90);//Clave
    jtb_catalogo_articulos2.getColumnModel().getColumn(4).setPreferredWidth(140);//Descripcion
    jtb_catalogo_articulos2.getColumnModel().getColumn(5).setPreferredWidth(60);//item
    jtb_catalogo_articulos2.getColumnModel().getColumn(6).setPreferredWidth(60);//Linea
    jtb_catalogo_articulos2.getColumnModel().getColumn(7).setPreferredWidth(20);//Precio
    jtb_catalogo_articulos2.getColumnModel().getColumn(8).setPreferredWidth(60);//Fecha
    jtb_catalogo_articulos2.getColumnModel().getColumn(9).setPreferredWidth(40);//Acum
    jtb_catalogo_articulos2.getColumnModel().getColumn(10).setPreferredWidth(20);//Exist
    jtb_catalogo_articulos2.getColumnModel().getColumn(11).setPreferredWidth(20);//% Rotacion

    jtbl_articulosentiendas1.getColumnModel().getColumn(0).setPreferredWidth(60);//tem ent
    jtbl_articulosentiendas1.getColumnModel().getColumn(1).setPreferredWidth(30);//Familia
    jtbl_articulosentiendas1.getColumnModel().getColumn(2).setPreferredWidth(120);//Subfamilia
    jtbl_articulosentiendas1.getColumnModel().getColumn(3).setPreferredWidth(10);//Clave
    jtbl_articulosentiendas1.getColumnModel().getColumn(4).setPreferredWidth(10);//Descripcion
    jtbl_articulosentiendas1.getColumnModel().getColumn(5).setPreferredWidth(10);//item
    jtbl_articulosentiendas1.getColumnModel().getColumn(6).setPreferredWidth(15);//Linea
    jtbl_articulosentiendas1.getColumnModel().getColumn(7).setPreferredWidth(15);//Precio
    jtbl_articulosentiendas1.getColumnModel().getColumn(8).setPreferredWidth(10);//Fecha
    jtbl_articulosentiendas1.getColumnModel().getColumn(9).setPreferredWidth(10);//Acum
    jtbl_articulosentiendas1.getColumnModel().getColumn(10).setPreferredWidth(80);//Exist



    jtb_catalogo_articulos.getTableHeader().setBackground(Color.yellow);
    this.jtf_busqueda.requestFocus();
     /*if(JOptionPane.showConfirmDialog(null, "Desea cargar Datos")==0)
        {
            this.executabusqueda(0,0,"");
        }*/
    if(variables_global.getnivelusu()==8)
                {
                   this.jbtn_add_art.setVisible(false);
                   this.jbtn_traspasos.setVisible(false);
                   this.jbtn_generorequisicion.setVisible(false);
                   //this.jtb_inveprogramados.setVisible(false);
                   this.jbtn_movimientosalmacen.setVisible(false);
                   this.jbtn_articulospromocion.setVisible(false);
                   this.jbtn_salir1.setVisible(false);
                }
   idc=1;
   this.iniciar_modelo_tiendasexisc();
   controlcombo=1;
    }

private void iniciar_modelo_de_tabla()
{
        jtable_modelo=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo.addColumn("<html><b>Temp. Ent.</b></html>");
        jtable_modelo.addColumn("<html><b>Familia</b></html>");
        jtable_modelo.addColumn("<html><b>Sub_fam.</b></html>");
        jtable_modelo.addColumn("<html><b>Clave</b></html>");
        jtable_modelo.addColumn("<html><b>Descripcion.</b></html>");
        jtable_modelo.addColumn("<html><b>Item.</b></html>");
        jtable_modelo.addColumn("<html><b>Linea</b></html>");
        jtable_modelo.addColumn("<html><b>Precio</b></html>");
        jtable_modelo.addColumn("<html><b>F. Ult.Compra</b></html>");
        jtable_modelo.addColumn("<html><b>Acum V.</b></html>");
        jtable_modelo.addColumn("<html><b>Exis.</b></html>");
        jtable_modelo.addColumn("<html><b>%Rotacion</b></html>");
}
private void iniciar_modelo_de_tabla2()
{
        jtable_modelo2=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo2.addColumn("<html><b>Temp. Ent.</b></html>");
        jtable_modelo2.addColumn("<html><b>Familia</b></html>");
        jtable_modelo2.addColumn("<html><b>Sub_fam.</b></html>");
        jtable_modelo2.addColumn("<html><b>Clave</b></html>");
        jtable_modelo2.addColumn("<html><b>Descripcion.</b></html>");
        jtable_modelo2.addColumn("<html><b>Item.</b></html>");
        jtable_modelo2.addColumn("<html><b>Linea</b></html>");
        jtable_modelo2.addColumn("<html><b>Precio</b></html>");
        jtable_modelo2.addColumn("<html><b>F. Ult.Compra</b></html>");
        jtable_modelo2.addColumn("<html><b>Acum V.</b></html>");
        jtable_modelo2.addColumn("<html><b>Exis.</b></html>");
        jtable_modelo2.addColumn("<html><b>%Rotacion</b></html>");
}
private void iniciar_modelo_de_tablapromo()
{
        jtable_modelop=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelop.addColumn("<html><b>Tienda</b></html>");
        jtable_modelop.addColumn("<html><b>Clave</b></html>");
        jtable_modelop.addColumn("<html><b>Descripcion</b></html>");
        jtable_modelop.addColumn("<html><b>Precio</b></html>");
        jtable_modelop.addColumn("<html><b>Promocion</b></html>");
        jtable_modelop.addColumn("<html><b>Desc</b></html>");
        jtable_modelop.addColumn("<html><b>Fecha</b></html>");

}
private void iniciar_modelo_artiexistencias()
    {
        jtable_modelo_existencias=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_existencias.addColumn("Clave");
        jtable_modelo_existencias.addColumn("Descripcion.");
        jtable_modelo_existencias.addColumn("Item");
       //se crea intancia de la clase conexion
    }
private void iniciar_modelo_tiendasexis()
    {
        String texto="select * from x1distribucion_tiendas_activas(8,'','') as (tie_descri character varying(35),tie_id integer,idbod integer);";
        System.out.println("tiendas armar:"+texto);
        try
            {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {

                      jtable_modelo_existencias.addColumn("<html><b>"+rs.getString("tie_id")+":"+rs.getString("tie_descri")+":"+rs.getString("idbod")+"</b></html>");
                     // this.jcbx_tiendas.addItem(rs.getString("tie_id")+":"+rs.getString("tie_descri")+":"+rs.getString("idbod"));
                    }
               controltiendas=1;
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    }

private void iniciar_modelo_etiq()
    {
        jtable_modelo_etiq=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_etiq.addColumn("Clave");
        jtable_modelo_etiq.addColumn("codigo Barra");
        jtable_modelo_etiq.addColumn("Descripcion");
        jtable_modelo_etiq.addColumn("Item");
        jtable_modelo_etiq.addColumn("Precio");
        jtable_modelo_etiq.addColumn("Cantidad");
        jtable_modelo_etiq.addColumn("Foto");
       //se crea intancia de la clase conexion
    }
private void iniciar_modelo_Promosug()
    {
        jtable_modelo_prosug=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_prosug.addColumn("Clave");
        jtable_modelo_prosug.addColumn("Descripcion.");
        jtable_modelo_prosug.addColumn("Precio");
        jtable_modelo_prosug.addColumn("F.Solicita");
        jtable_modelo_prosug.addColumn("Origen");
       //se crea intancia de la clase conexion
    }




private void iniciar_modelo_detallealmabod()
        {
        jtable_modelo_detallealmab=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_detallealmab.addColumn("<html><BODY><b>Viaje</b></BODY></html>");
        jtable_modelo_detallealmab.addColumn("<html><BODY><b>Clave</b></BODY></html>");
        jtable_modelo_detallealmab.addColumn("<html><BODY><b>Descripcion</b></BODY></html>");
        jtable_modelo_detallealmab.addColumn("<html><BODY><b>Precio</b></BODY></html>");
        jtable_modelo_detallealmab.addColumn("<html><BODY><b>P. Reb</b></BODY></html>");
        jtable_modelo_detallealmab.addColumn("<html><BODY><b>compras</b></BODY></html>");
        jtable_modelo_detallealmab.addColumn("<html><BODY><b>Acum.Compras</b></BODY></html>");
        jtable_modelo_detallealmab.addColumn("<html><BODY><b>Acum.Ventas</b></BODY></html>");
        jtable_modelo_detallealmab.addColumn("<html><BODY><b>Exi.bod</b></BODY></html>");
        jtable_modelo_detallealmab.addColumn("<html><BODY><b>Exi.Tie</b></BODY></html>");
        jtable_modelo_detallealmab.addColumn("<html><BODY><b>Ubicacion Bodega</b></BODY></html>");
        jtable_modelo_detallealmab.addColumn("<html><BODY><b>Ubicacion Tienda</b></BODY></html>");
        jtable_modelo_detallealmab.addColumn("<html><BODY><b>Id</b></BODY></html>");
     }
private void iniciar_modelo_tiendasexisc()
    {
        try
            {
               rs = x.sieuno_executediversosv2("select * from x1distribucion_tiendas_activas(8,'','') as (tie_descri character varying(35),tie_id integer,idbod integer);",variables_global.getconexiongral());
               while (rs.next())
                    {
                      this.jcbx_tiendas.addItem(rs.getString("tie_id")+":"+rs.getString("tie_descri")+":"+rs.getString("idbod"));
                    }

             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    }

private void iniciar_modelo_almacenes(String idt,String idb)
    {
        String texto="select * from x1sieuno_articulo_inven_ubicacion(1,"+idt+",'','','','') as (id smallint,des text)";
        System.out.println("Ubicacion:"+texto);
        modelout.removeAllElements();
        modeloub.removeAllElements();
        try
            {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {
                          modelout.addElement(rs.getString("id")+":"+rs.getString("des"));
                    }
            }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
        try
            {
               rs = x.sieuno_executediversosv2("select * from x1sieuno_articulo_inven_ubicacion(1,"+idb+",'','','','') as (id smallint,des text);",variables_global.getconexiongral());
               while (rs.next())
                    {
                          modeloub.addElement(rs.getString("id")+":"+rs.getString("des"));
                    }
            }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    }

private void iniciar_modelo_historial_Hubicacion(String idt,String idp)
    {
        String texto="select * from x1sieuno_articulo_inven_ubicacion(5,"+idt+",'"+idp+"','','','') as (idp integer,fechaa date,id smallint,des text)";
        System.out.println("Ubicacion:"+texto);
        modeloubhis.removeAllElements();
        modeloubhis.addElement("Historial de Ubicacion");
        try
            {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {
                          modeloubhis.addElement(this.fechaeuropea(rs.getString("fechaa"))+" En "+rs.getString("des"));
                    }
            }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
        
    }
private void contruir_totales()
    {
         Object[] fnewRow = new Object[13];
         DecimalFormat myFormatter = new DecimalFormat("############");
         float totalc=0,totalv=0,totaleb=0,totalet=0;
         //int totalfilasreporte=this.jtable_modelo_detalledistribucion.getRowCount()-1,i=0,ii=0;
         int i=0,ii=0;

        for( ii=0;ii<this.jtable_modelo_detallealmab.getRowCount();ii++)
            {
                        totalc+=Float.valueOf(jtable_modelo_detallealmab.getValueAt(ii, 8).toString())*Float.valueOf(jtable_modelo_detallealmab.getValueAt(ii, 3).toString());
                        totalv+=Float.valueOf(jtable_modelo_detallealmab.getValueAt(ii, 9).toString())*Float.valueOf(jtable_modelo_detallealmab.getValueAt(ii, 3).toString());
            }
            this.jtf_preciobodega.setText(myFormatter.format(totalc));
            this.jtf_preciotienda.setText(myFormatter.format(totalv));
         totalc=0;
         totalv=0;

         for( ii=0;ii<this.jtable_modelo_detallealmab.getRowCount();ii++)
            {
                        totalc+=Float.valueOf(jtable_modelo_detallealmab.getValueAt(ii, 6).toString());
                        totalv+=Float.valueOf(jtable_modelo_detallealmab.getValueAt(ii, 7).toString());
                        totaleb+=Float.valueOf(jtable_modelo_detallealmab.getValueAt(ii, 8).toString());
                        totalet+=Float.valueOf(jtable_modelo_detallealmab.getValueAt(ii, 9).toString());


            }
            fnewRow[0]=".";
            fnewRow[1]=".";
            fnewRow[2]="Totales:";
            fnewRow[3]=".";
            fnewRow[4]=".";
            fnewRow[5]=".";
            fnewRow[6]=myFormatter.format(totalc);
            fnewRow[7]=myFormatter.format(totalv);
            fnewRow[8]=myFormatter.format(totaleb);
            fnewRow[9]=myFormatter.format(totalet);
            fnewRow[10]=".";
            fnewRow[11]=".";
            fnewRow[12]=".";
            jtable_modelo_detallealmab.addRow(fnewRow);

     }
private void distribucionfotos()
    {
        int i=0;
        String clave="";
        for( i=0;i<this.jtable_modelo_etiq.getRowCount();i++)
                {
                    jtb_catalogo_articulos1.setRowHeight(i, 140);
                    clave=jtable_modelo_etiq.getValueAt(i,0).toString();
                    jtable_modelo_etiq.setValueAt("<html><head></head><body><p style=\"margin-top: 0\"><img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+clave+".JPG\" width=\"180\" height=\"120\" border=\"0\" alt=\"Foto\"></img></p></body></html>",i,6);
                }
    }
private void dioclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_catalogo_articulos.getSelectedRow();
         String valor[] = jtb_catalogo_articulos.getValueAt(fila, 3).toString().split(":");

        articulos_sie_editar fase=new articulos_sie_editar(valor[0]);
        fase.pack();
        fase.setVisible(true);
        //setVisible(false);
    }
private void dioclickfoto(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
        System.out.println("dio doble  click");
        int fila = jtb_catalogo_articulos.getSelectedRow();
        String valor[] = jtb_catalogo_articulos.getValueAt(fila, 3).toString().split(":");

        this.jtf_idarticulocat.setText(valor[1]);
        //setVisible(false);
    }
private void dioclickexi(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_catalogo_artiexis.getSelectedRow();
         String valor[] = jtb_catalogo_artiexis.getValueAt(fila, 1).toString().split(":");

        //JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
        articulos_sie_editar fase=new articulos_sie_editar(valor[0]);
        fase.pack();
        fase.setVisible(true);
        //setVisible(false);
    }
private void dioclickidartideta(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         //System.out.println("dio doble  click");
         int fila = jtb_catalogo_artiexis.getSelectedRow();
         this.jtf_idarticulo_exi.setText(jtable_modelo_existencias.getValueAt(fila, 0).toString());
         this.jep_articuloimagen.setText("<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+jtable_modelo_existencias.getValueAt(fila, 0).toString()+".JPG\" width=\"180\" height=\"140\" border=\"0\" alt=\"Foto Articulo\"></img>");

    }
private void dioclickidartidetaubi(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         //System.out.println("dio doble  click");
         int fila = jtbl_articulosentiendas1.getSelectedRow();
         this.jtf_idarticulo_exi.setText(jtable_modelo_detallealmab.getValueAt(fila, 1).toString());
         this.jtf_idarticulo_exi1.setText(jtable_modelo_detallealmab.getValueAt(fila, 1).toString());
         this.jtf_idarticulo_exi2.setText(jtable_modelo_detallealmab.getValueAt(fila, 12).toString());
         this.jep_articuloimagen1.setText("<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+jtable_modelo_detallealmab.getValueAt(fila, 1).toString()+".JPG\" width=\"160\" height=\"110\" border=\"0\" alt=\"Foto Articulo\"></img>");
         String idtie[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
         if(modoope==2)
            {
            if(almacen==1)
                {
                    this.iniciar_modelo_historial_Hubicacion(idtie[0],jtable_modelo_detallealmab.getValueAt(fila, 12).toString());
                }
             if(almacen==2)
                {
                this.iniciar_modelo_historial_Hubicacion(idtie[2],jtable_modelo_detallealmab.getValueAt(fila, 12).toString());
                }
            }
    }
private void dioclickpromo(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
         int fila = jtb_catalogo_articulos2.getSelectedRow();
         String valor[] = jtable_modelo2.getValueAt(fila, 3).toString().split(":");
 if(JOptionPane.showConfirmDialog(null, "Desea ver Promociones?")==0)
        {
            this.jtf_idproductopromo.setText(valor[1]);
            this.jtf_idartsug.setText(valor[0]);
            this.carga_datos_articulotodaslastiendas(valor[0]);
        //setVisible(false);
       }
    }

private void dioclickviaje(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
      
    }

private void tendresuerte() {
        // TODO add your handling code here:
         System.out.println("dio doble  click");

         Object valor = jtb_catalogo_articulos.getValueAt(0, 4);

        //JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
        articulos_sie_editar fase=new articulos_sie_editar(valor.toString());
        fase.pack();
        fase.setVisible(true);
        //setVisible(false);
    }
private void dioclickht(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
      String msg="",texto="",ubih="";
    if(modoope==1)
    {
        msg="Desea Establecer el Contenedor";
    }
    if(modoope==2)
    {
        msg="Desea Consultar este Contenedor";
    }
    if(modoope==3)
    {
        msg="para asignar ubicaciones secundarias Elija un articulo unicamente";
    }
     if(JOptionPane.showConfirmDialog(null, ""+msg+"?")==0)
            {
                almacen=2;
                if(modoope==1)
                {
                    String idtie[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                    this.jtf_tiendaarti2.setText(this.jlst_clientesdistribucion2.getSelectedValue().toString());
                    this.id_tienda.setText(idtie[2]);
                    this.id_tienda1.setText(idtie[1]);
                        int filastar=this.jtbl_articulosentiendas1.getSelectedRow();
                        int filastaf=jtbl_articulosentiendas1.getSelectionModel().getMaxSelectionIndex()+1;

                        if(JOptionPane.showConfirmDialog(null, "<html><b><h2>Confirmar Hubicacion?<br>"+this.jtf_tiendaarti2.getText()+"<br>Clave Inicio:"+jtable_modelo_detallealmab.getValueAt(filastar ,1)+"<br>Clave Final:"+jtable_modelo_detallealmab.getValueAt(filastaf-1,1)+"</h2></b></html>")==0)
                            {
                                String selectin="",ubi[]=null;
                                ubi=this.jtf_tiendaarti2.getText().toString().split(":");
                                System.out.println("Fila inicial:"+filastar+"  fila final:"+filastaf);
                                int ii=0,confirma=0,recorrido=0;

                                for( ii=filastar;ii<filastaf;ii++)
                                    {
                                        if (recorrido>0)
                                            {
                                                selectin+=".";
                                            }
                                        selectin+=""+jtable_modelo_detallealmab.getValueAt(ii ,12)+"";
                                         recorrido++;
                                        //this.jtable_modelo_detallealmab.setValueAt(ubi[1], ii, 10);
                                    }
                                    texto="select * from x1sieuno_articulo_inven_ubicacion_update(5,"+this.id_tienda.getText()+",'"+selectin+"','"+ubi[0]+"','','')";
                                      
                                        System.out.println(texto);
                                    try
                                        {
                                            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                            while (rs.next())
                                                {
                                                    confirma=rs.getInt(1);
                                                }
                                        }
                                        catch(Exception e)
                                                {
                                                    System.out.println(e.getMessage());
                                                }
                                        if ((confirma==1) || (confirma==5))
                                                {
                                                    JOptionPane.showMessageDialog(null,"Gracias datos Actualizados Correctamente", "Sistema Integral Insumos",1);
                                                        //while(jtable_modelo_alm_updatereplace.getRowCount()>0)jtable_modelo_alm_updatereplace.removeRow(0);
                                                    if(confirma==1)
                                                    {
                                                    for( ii=filastar;ii<filastaf;ii++)
                                                        {
                                                            this.jtable_modelo_detallealmab.setValueAt(ubi[1], ii, 10);
                                                        }
                                                    }
                                                    if(confirma==5)
                                                    {
                                                            ubih=jtable_modelo_detallealmab.getValueAt(filastar, 10).toString();
                                                            this.jtable_modelo_detallealmab.setValueAt(ubih+","+ubi[1], filastar, 10);

                                                    }
                                                    this.jtf_busqueda.requestFocus();
                                                }
                                    else
                                                {
                                                    JOptionPane.showMessageDialog(null,"Error Consulte con Su Administrador", "Sistema Integral Insumos",1);
                                                }
                        }
//                    this.carga_datos_detallealmacenaybvigencia(21, idtie[0],buscampv);
                }
                if(modoope==2)
                {
                        this.jtf_tiendaarti2.setText(this.jlst_clientesdistribucion2.getSelectedValue().toString());
                        String idu[]=this.jlst_clientesdistribucion2.getSelectedValue().toString().split(":");
                        String arreglo_tiendas[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                        this.carga_datos_detallealmacenbod(18,arreglo_tiendas[2],idu[0],2);
                        this.verexistencias_bod(arreglo_tiendas[0],9);
                }
            if(modoope==3)
                {
                    String idtie[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                    this.jtf_tiendaarti2.setText(this.jlst_clientesdistribucion2.getSelectedValue().toString());
                    this.id_tienda.setText(idtie[2]);
                    this.id_tienda1.setText(idtie[1]);
                    int filastar=this.jtbl_articulosentiendas1.getSelectedRow();
                    int filastaf=jtbl_articulosentiendas1.getSelectionModel().getMaxSelectionIndex()+1;
                    if(JOptionPane.showConfirmDialog(null, "<html><b><h2>Confirmar Hubicacion Secundaria?<br>"+this.jtf_tiendaarti2.getText()+"<br>Clave :"+this.jtf_idarticulo_exi1.getText()+"</h2></b></html>")==0)
                            {
                                String selectin="",ubi[]=null;
                                ubi=this.jtf_tiendaarti2.getText().toString().split(":");

                                int ii=0,confirma=0,recorrido=0;
                                texto="select * from x1sieuno_articulo_inven_ubicacion_update(4,"+this.id_tienda.getText()+",'"+this.jtf_idarticulo_exi2.getText()+"','"+ubi[0]+"','','')";

                                        System.out.println(texto);
                                    try
                                        {
                                            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                            while (rs.next())
                                                {
                                                    confirma=rs.getInt(1);
                                                }
                                        }
                                        catch(Exception e)
                                                {
                                                    System.out.println(e.getMessage());
                                                }
                                        if ((confirma==1) || (confirma==5))
                                                {
                                                    JOptionPane.showMessageDialog(null,"Gracias datos Actualizados Correctamente", "Sistema Integral Insumos",1);
                                                        //while(jtable_modelo_alm_updatereplace.getRowCount()>0)jtable_modelo_alm_updatereplace.removeRow(0);
                                                    if(confirma==5)
                                                    {
                                                            ubih=jtable_modelo_detallealmab.getValueAt(filastar, 10).toString();
                                                            this.jtable_modelo_detallealmab.setValueAt(ubih+","+ubi[1], filastar, 10);
                                                    }
                                                    this.jtf_busqueda.requestFocus();
                                                }
                                    else
                                                {
                                                    JOptionPane.showMessageDialog(null,"Error Consulte con Su Administrador", "Sistema Integral Insumos",1);
                                                }
                        }
//                    this.carga_datos_detallealmacenaybvigencia(21, idtie[0],buscampv);
                }
            }

    }
private void dioclickhb(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    String msg="",texto="",ubih="";
    if(modoope==1)
    {
        msg="Desea Asignar los Articulos?";
    }
    if(modoope==2)
    {
        msg="Desea Consultar este Contenedor";
    }
    if(modoope==3)
    {
        msg="para asignar ubicaciones secundarias Elija un articulo unicamente";
    }
     if(JOptionPane.showConfirmDialog(null, ""+msg+"?")==0)
            {
                almacen=1;
                String idu[]=this.jlst_clientesdistribucion3.getSelectedValue().toString().split(":");
                if(modoope==1)
                {
                   String idtie[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                    this.jtf_tiendaarti2.setText(this.jlst_clientesdistribucion3.getSelectedValue().toString());
                    this.id_tienda.setText(idtie[0]);
                    this.id_tienda1.setText(idtie[1]);
                        int filastar=this.jtbl_articulosentiendas1.getSelectedRow();
                        int filastaf=jtbl_articulosentiendas1.getSelectionModel().getMaxSelectionIndex()+1;

                        if(JOptionPane.showConfirmDialog(null, "<html><b><h2>Confirmar Hubicacion?<br>"+this.jtf_tiendaarti2.getText()+"<br>Clave Inicio:"+jtable_modelo_detallealmab.getValueAt(filastar ,1)+"<br>Clave Final:"+jtable_modelo_detallealmab.getValueAt(filastaf-1,1)+"</h2></b></html>")==0)
                            {
                                String selectin="",ubi[]=null;
                                ubi=this.jtf_tiendaarti2.getText().toString().split(":");
                                System.out.println("Fila inicial:"+filastar+"  fila final:"+filastaf);
                                int ii=0,confirma=0,recorrido=0;

                                for( ii=filastar;ii<filastaf;ii++)
                                    {
                                        if (recorrido>0)
                                            {
                                                selectin+=".";
                                            }
                                        selectin+=""+jtable_modelo_detallealmab.getValueAt(ii ,12)+"";
                                        recorrido++;
                                        //this.jtable_modelo_detallealmab.setValueAt(ubi[1], ii, 11);
                                    }

                                        System.out.println(selectin);
                                        if(filastar==(filastaf-1))
                                            {
                                                texto="select * from x1sieuno_articulo_inven_ubicacion_update(4,"+this.id_tienda.getText()+",'"+selectin.replace(".", "")+"','"+ubi[0]+"','','')";
                                            }
                                        else
                                            {
                                                texto="select * from x1sieuno_articulo_inven_ubicacion_update(5,"+this.id_tienda.getText()+",'"+selectin+"','"+ubi[0]+"','','')";
                                            }

                                        System.out.println(texto);
                                    try
                                        {
                                            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                            while (rs.next())
                                                {
                                                    confirma=rs.getInt(1);
                                                }
                                        }
                                        catch(Exception e)
                                                {
                                                    System.out.println(e.getMessage());
                                                }
                                        if ((confirma==1) || (confirma==5))
                                                {
                                                    JOptionPane.showMessageDialog(null,"Gracias datos Actualizados Correctamente", "Sistema Integral Insumos",1);
                                                        //while(jtable_modelo_alm_updatereplace.getRowCount()>0)jtable_modelo_alm_updatereplace.removeRow(0);
                                                    if(confirma==1)
                                                    {
                                                    for( ii=filastar;ii<filastaf;ii++)
                                                        {
                                                            this.jtable_modelo_detallealmab.setValueAt(ubi[1], ii, 11);
                                                        }
                                                    }
                                                    if(confirma==5)
                                                    {
                                                            ubih=jtable_modelo_detallealmab.getValueAt(filastar, 11).toString();
                                                            this.jtable_modelo_detallealmab.setValueAt(ubih+","+ubi[1], filastar, 11);

                                                    }
                                                    this.jtf_busqueda.requestFocus();
                                                }
                                    else
                                                {
                                                    JOptionPane.showMessageDialog(null,"Error Consulte con Su Administrador", "Sistema Integral Insumos",1);
                                                }
                        }
//                    this.carga_datos_detallealmacenaybvigencia(21, idtie[0],buscampv);
                }
                if(modoope==2)
                {
                            this.jtf_tiendaarti2.setText(this.jlst_clientesdistribucion3.getSelectedValue().toString());
                            String arreglo_tiendas[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                            this.carga_datos_detallealmacenbod(18,arreglo_tiendas[0],idu[0],1);
                            this.verexistencias_bod(arreglo_tiendas[2],8);
                }

                if(modoope==3)
                {
                   String idtie[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                    this.jtf_tiendaarti2.setText(this.jlst_clientesdistribucion3.getSelectedValue().toString());
                    this.id_tienda.setText(idtie[0]);
                    this.id_tienda1.setText(idtie[1]);
                        int filastar=this.jtbl_articulosentiendas1.getSelectedRow();
                        int filastaf=jtbl_articulosentiendas1.getSelectionModel().getMaxSelectionIndex()+1;

                        if(JOptionPane.showConfirmDialog(null, "<html><b><h2>Confirmar Hubicacion Secundaria?<br>"+this.jtf_tiendaarti2.getText()+"<br>Clave :"+this.jtf_idarticulo_exi1.getText()+"</h2></b></html>")==0)
                            {
                                String selectin="",ubi[]=null;
                                ubi=this.jtf_tiendaarti2.getText().toString().split(":");
                                System.out.println("Fila inicial:"+filastar+"  fila final:"+filastaf);
                                int ii=0,confirma=0,recorrido=0;
                                  System.out.println(selectin);
                                  texto="select * from x1sieuno_articulo_inven_ubicacion_update(4,"+this.id_tienda.getText()+",'"+this.jtf_idarticulo_exi2.getText()+"','"+ubi[0]+"','','')";
                                  System.out.println(texto);
                                    try
                                        {
                                            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                            while (rs.next())
                                                {
                                                    confirma=rs.getInt(1);
                                                }
                                        }
                                        catch(Exception e)
                                                {
                                                    System.out.println(e.getMessage());
                                                }
                                        if ((confirma==1) || (confirma==5))
                                                {
                                                    JOptionPane.showMessageDialog(null,"Gracias datos Actualizados Correctamente", "Sistema Integral Insumos",1);
                                                        //while(jtable_modelo_alm_updatereplace.getRowCount()>0)jtable_modelo_alm_updatereplace.removeRow(0);
                                                    if(confirma==1)
                                                    {
                                                    for( ii=filastar;ii<filastaf;ii++)
                                                        {
                                                            this.jtable_modelo_detallealmab.setValueAt(ubi[1], ii, 11);
                                                        }
                                                    }
                                                    if(confirma==5)
                                                    {
                                                            ubih=jtable_modelo_detallealmab.getValueAt(filastar, 11).toString();
                                                            this.jtable_modelo_detallealmab.setValueAt(ubih+","+ubi[1], filastar, 11);

                                                    }
                                                    this.jtf_busqueda.requestFocus();
                                                }
                                    else
                                                {
                                                    JOptionPane.showMessageDialog(null,"Error Consulte con Su Administrador", "Sistema Integral Insumos",1);
                                                }
                        }
//                    this.carga_datos_detallealmacenaybvigencia(21, idtie[0],buscampv);
                }

            }

    }
private void carga_datos_detallealmacenbod(int opcion,String idtienda,String viaje,int lugar)
        {
            String texto="";
            float importe=0,importe2=0,acumulado=0,piezas=0,piezas2=0;
            while(jtable_modelo_detallealmab.getRowCount()>0)jtable_modelo_detallealmab.removeRow(0);
            while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);
            texto="select * from x1sieuno_articulo_detalle_ventasacumv3("+opcion+","+idtienda+",'"+viaje+"','"+viaje+"','2') as (exitab numeric,exi double precision,cod text,descor text,preve double precision,pre_re real,idp integer,clavepro character varying(16),descuento numeric,exit numeric,exib numeric,acumv numeric,fechauc date,acumcompras numeric,ncompras numeric,idclasif smallint,viaje character varying(30),hubi text)";

            System.out.println(texto);
            String despartido[]=null,texto2="",htmlabre="<html><BODY>",htmlcierra="</BODY></html>",colorabre="",colorcierra="",tibu[]=null;
            Object[] fnewRow = new Object[13];
            Object[] fnewRow2 = new Object[12];
            Object[] fnewRowe = new Object[3];

            DecimalFormat myFormad = new DecimalFormat("############");
            DecimalFormat myForma = new DecimalFormat("############.##");
            DecimalFormat myForma2 = new DecimalFormat("###,###,###,###.##");
             int artreb=0,artpro=0;
            double texi=0,tcos=0,tpre=0,tprer=0,descu=0,exireb=0,exides=0;
            try
               {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {
                            fnewRow[0]=rs.getString ("viaje");
                            fnewRow[1]=rs.getString ("clavepro");
                            fnewRow[2]=rs.getString ("descor");
                            fnewRow[3]=myForma.format(rs.getFloat("preve"))+" ";
                            if(rs.getString("pre_re")!=null)
                                {
                                    fnewRow[4]=rs.getString("pre_re")+"";
                                }
                            else
                                {
                                   if(rs.getFloat("descuento")>0)
                                        {
                                            fnewRow[4]=myFormad.format(rs.getFloat("descuento"))+"%";
                                        }
                                    else
                                        {
                                            fnewRow[4]="";
                                        }
                                }
                            fnewRow[5]=myForma.format(rs.getFloat("ncompras"))+"";
                            fnewRow[6]=myForma.format(rs.getFloat("acumcompras"))+"";
                            fnewRow[7]=myForma.format(rs.getFloat("acumv"))+"";
                            if(lugar==1)
                            {
                                fnewRow[8]="0";
                                fnewRow[9]=rs.getString ("exi")+"";
                                fnewRow[10]=".";
                                fnewRow[11]=rs.getString ("hubi");
                            }
                           if(lugar==2)
                            {
                                fnewRow[8]=rs.getString ("exi")+"";
                                fnewRow[9]="0";
                                fnewRow[10]=rs.getString ("hubi");
                                 fnewRow[11]=".";
                            }
                           if(lugar==3)
                            {
                                fnewRow[8]=rs.getString ("exib")+"";
                                fnewRow[9]=rs.getString ("exit")+"";
                                fnewRow[10]=".";
                                fnewRow[11]=rs.getString ("hubi");
                            }
                            if(lugar==4)
                            {
                                fnewRow[8]=rs.getString ("exib")+"";
                                fnewRow[9]=rs.getString ("exit")+"";
                                fnewRow[10]=rs.getString ("hubi");
                                fnewRow[11]=".";
                            }
                           fnewRow[12]=rs.getString("idp");
                           jtable_modelo_detallealmab.addRow(fnewRow);

                  fnewRow2[0]=".";
                  fnewRow2[1]=".";
                  fnewRow2[2]=".";
                  fnewRow2[3]=rs.getString("idp")+":"+rs.getString("clavepro");
                  fnewRow2[4]=rs.getString("descor").replace("/", " ");
                  fnewRow2[5]=".";
                  fnewRow2[6]=".";
                  fnewRow2[7]=rs.getString("preve");
                  if(rs.getString ("fechauc")!=null)
                      {
                        fnewRow2[8]=this.fechaeuropea(rs.getString ("fechauc"));
                        }
                  else
                  {
                        fnewRow2[8]="";
                  }
                  fnewRow2[9]=myForma.format(rs.getFloat("acumv"));
                  fnewRow2[10]=myForma.format(rs.getFloat("exi"));

                        piezas=rs.getFloat("acumv");
                        piezas2=rs.getFloat("exi");
                        acumulado=piezas+piezas2;
                        importe=(piezas/acumulado)*100;
                        colorabre="";
                        colorcierra="";
                        if (importe<=50)
                            {
                                colorabre="<b><font color=#CC0000>";
                                colorcierra="<font></b>";
                            }
                        if ((importe>50) && (importe<=75))
                            {
                                colorabre="<b><font color=#0000FF>";
                                colorcierra="<font></b>";
                            }
                        if (importe>75)
                            {
                                colorabre="<b><font color=#00FF00>";
                                colorcierra="<font></b>";
                            }
                  fnewRow2[11]=htmlabre+colorabre+myForma.format(importe)+"%"+colorcierra+htmlcierra;
                    jtable_modelo.addRow(fnewRow2);

                    fnewRowe[0]=rs.getString("clavepro");
                  fnewRowe[1]=rs.getString("idp")+":"+rs.getString ("descor");
                  fnewRowe[2]=""+".";
                  jtable_modelo_existencias.addRow(fnewRowe);
                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }
           this.jtf_tiendaarti1.setText(""+jtable_modelo_detallealmab.getRowCount());

String selectin="";
if(this.jtable_modelo_detallealmab.getRowCount()>0)
{
        for( int ii=0;ii<this.jtable_modelo_detallealmab.getRowCount();ii++)
                {
                if (ii>0)
                    {
                        selectin+=".";
                    }
                selectin+=""+jtable_modelo_detallealmab.getValueAt(ii ,12)+"";
                }

    System.out.println(selectin);
    tibu=this.jcbx_tiendas.getSelectedItem().toString().split(":");
     if((lugar==1) || (lugar==3))
         {
            texto="select * from x1sieuno_articulo_inven_ubicacion(4,"+tibu[2]+",'"+selectin+"','','','') as (idpro integer,fecha date,idubi smallint,hubi text)";
         }
     else
        {
            texto="select * from x1sieuno_articulo_inven_ubicacion(4,"+tibu[0]+",'"+selectin+"','','','') as (idpro integer,fecha date,idubi smallint,hubi text)";
        }
            System.out.println(texto);

            try
                {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                while (rs.next())
                    {
                            //despartido=rs.getString("descor").split(":");
                            if((lugar==1) || (lugar==3))
                            this.crea_hoja_agregaexistenciastb(rs.getString("idpro"),"",8,rs.getString("hubi"),"",2);
                            else
                            this.crea_hoja_agregaexistenciastb(rs.getString("idpro"),"",9,rs.getString("hubi"),"",2);


                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }
}//fin de busqueda de historal
        }
private void verexistencias()
        {

    int numerofilas = this.jtable_modelo_existencias.getRowCount(),ii=0;
    String selectin="";
        for( ii=0;ii<numerofilas;ii++)
                {
                if (ii>0)
                    {
                        selectin+=".";
                    }
                selectin+=""+jtable_modelo_existencias.getValueAt(ii ,0)+"";
                }

    System.out.println(selectin);
            String texto="select * from x1sieuno_articulo_detalle(1,0,'','"+selectin+"') as (ida integer,min integer,max integer,exi double precision,idp integer,cod text,cndt integer,descor text,preve double precision,pre_re real,clavepro text)";
            System.out.println(texto);
            String despartido[]=null,mi="",ma="";
            int columnatitulo=0;
            try
                {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                while (rs.next())
                    {
                            despartido=rs.getString("descor").split(":");

                            columnatitulo=this.findcolumna_idtienda(despartido[0]);
                            System.out.println(rs.getString("descor")+"en columna:"+columnatitulo);
                             if ((rs.getString("max")!=null) && (rs.getString("min")!=null))
                        {
                            mi=rs.getString("min");
                            ma=rs.getString("max");

                        }
                    else
                        {
                            mi="0";
                            ma="0";
                        }
                    if ( columnatitulo>0)
                        {
                            this.crea_hoja_agregaexistencias(rs.getString("clavepro"),rs.getString("exi"),columnatitulo,mi,ma);
                        }
                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }
            
        }
private void verexistencias_bod(String tienda,int colum)
        {

    int numerofilas = this.jtable_modelo_detallealmab.getRowCount(),ii=0;
    String selectin="";
        for( ii=0;ii<numerofilas;ii++)
                {
                if (ii>0)
                    {
                        selectin+=".";
                    }
                selectin+=""+jtable_modelo_detallealmab.getValueAt(ii ,1)+"";
                }

    System.out.println(" voy a por existencias:"+selectin);
            String texto="select * from x1sieuno_articulo_detalle_ventasacumv3(17,"+tienda+",'','"+selectin+"','') as (exitab numeric,exi double precision,cod text,descor text,preve double precision,pre_re real,idp integer,clavepro character varying(16),descuento numeric,exit numeric,exib numeric,acumv numeric,fechauc date,acumcompras numeric,ncompras numeric,idclasif smallint,viaje character varying(30),hubi text)";
            System.out.println(texto);
            String despartido[]=null,mi="",ma="";
            int columnatitulo=0;
            try
                {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                while (rs.next())
                    {
                            //despartido=rs.getString("descor").split(":");
                            this.crea_hoja_agregaexistenciastb(rs.getString("clavepro"),rs.getString("exi"),colum,rs.getString("hubi"),ma,1);


                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }
                this.contruir_totales();
        }
private void carga_datos_articulotodaslastiendas(String idarticulo)
        {
            String texto="select * from x1sieuno_articulo_detalle_promo_indviduales(2,0,'"+idarticulo+"','','','') as (iddes integer,idalmpro integer,idcatdes integer,iddetdes integer,descrip text,idpro integer,descor text,precio double precision,clavepro text,ultimo numeric,famart integer,subfam integer,por real,fe date,fef date)";
            System.out.println(texto);
            String despartido[]=null;
            Object[] fnewRow = new Object[7];
            DecimalFormat myForma = new DecimalFormat("###,###,###,###");
            while(jtable_modelop.getRowCount()>0)jtable_modelop.removeRow(0);
            try
               {
               rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
               while (rs.next())
                    {
                            despartido=rs.getString("descor").split(":");
                            fnewRow[0]=despartido[0]+":"+despartido[2];
                            fnewRow[1]=rs.getString("clavepro");
                            fnewRow[2]=despartido[1];
                            fnewRow[3]=rs.getString("precio")+"";
                            fnewRow[4]=rs.getString("descrip");
                            fnewRow[5]=rs.getString("por")+"%";
                            fnewRow[6]=this.fechaeuropea(rs.getString("fe")).substring(0, 2)+ " A "+this.fechaeuropea(rs.getString("fef"));

                            jtable_modelop.addRow(fnewRow);

                    }
                }
            catch(Exception e)
                {
                    System.out.println(e.getMessage());
                }
this.jlbl_cantidadregistros1.setText(String.valueOf(this.jtable_modelop.getRowCount()));
this.jLabel6.setText("Busqueda Promocion::"+this.jtf_idproductopromo.getText().toUpperCase().trim());

}
private int findcolumna_idtienda (String titulo)  {
        int columnas = jtable_modelo_existencias.getColumnCount(),columencontrado=0;
        String columtitulo[]=null;
      for(int j = 2 ;j < columnas ; j++)
            {
                   columtitulo= jtable_modelo_existencias.getColumnName(j).replace("<html><b>","").replace("</b></html>","").split(":");
                if(columtitulo[0].equals(titulo))
                    {
                            columencontrado=j;
                            j=columnas;
                    }
            }
    //System.out.println("Esto encontro:"+columencontrado);
    return columencontrado;
}
private void crea_hoja_agregaexistencias(String codigo,String existencia,int columna,String smin,String smax)
    {
        DecimalFormat miformat = new DecimalFormat("###,###,###");
        int numerofilas=this.jtable_modelo_existencias.getRowCount(),numerocolumnas=this.jtable_modelo_existencias.getColumnCount(),ii=00,encontrado=0;
        String mesactual="",colorabre="",colorcierra="";

        float abononumerico=0,importe=0;
       //invoco al metodo que trae el recordset de datos
        abononumerico=Float.valueOf(existencia);

        importe=100-((Float.valueOf(existencia)/Float.valueOf(smax))*100);
        //System.out.println("Verificando :"+smax+" "+existencia+ " "+importe);
                if (importe<=50)
                    {
                        colorabre="<b><font color=#CC0000>";
                        colorcierra="<font></b>";
                    }
                if ((importe>50) && (importe<=75))
                    {
                        //colorabre="<b><font color=#FF6633>";
                        colorabre="<b><font color=#0000FF>";
                        colorcierra="<font></b>";
                    }
                if (importe>75)
                    {
                        colorabre="<font color=#008000>";
                        colorcierra="<font>";
                    }
                if ((importe==0) && (abononumerico==0))
                    {
                        colorabre="";
                        colorcierra="";
                    }
        for( ii=0;ii<numerofilas;ii++)
                {
                    mesactual=jtable_modelo_existencias.getValueAt(ii, 0).toString();
                    // System.out.println("Agregando:"+mesactual+" "+mes);
                    if (mesactual.equals(codigo))
                        {
                            encontrado=1;
                            if(vde==1)
                            jtable_modelo_existencias.setValueAt("<html><b>"+colorabre+"M"+smin+" Mx"+smax+" E="+miformat.format(abononumerico)+colorcierra+"</b></html>",ii ,columna);
                            else
                            jtable_modelo_existencias.setValueAt(miformat.format(abononumerico),ii ,columna);
                        }
                }
    }
private void crea_hoja_agregaexistenciastb(String codigo,String existencia,int columna,String smin,String smax,int opcion)
    {
        DecimalFormat miformat = new DecimalFormat("###,###,###");
        int numerofilas=this.jtable_modelo_detallealmab.getRowCount(),numerocolumnas=this.jtable_modelo_detallealmab.getColumnCount(),ii=00,encontrado=0;
        String mesactual="",colorabre="",colorcierra="",hubica="";

        if (opcion==1)
            {
            for( ii=0;ii<numerofilas;ii++)
                {
                    mesactual=jtable_modelo_detallealmab.getValueAt(ii, 1).toString();
                    // System.out.println("Agregando:"+mesactual+" "+mes);
                    if (mesactual.equals(codigo))
                        {
                            encontrado=1;
                            //hubica=this.jtable_modelo_detallealmab.getValueAt(ii,10).toString();
                            
                            if(columna==8)
                                {
                                    jtable_modelo_detallealmab.setValueAt(existencia,ii ,8);
                                    jtable_modelo_detallealmab.setValueAt(smin,ii ,10);
                                }
                            else
                                {
                                    jtable_modelo_detallealmab.setValueAt(existencia,ii ,9);
                                    jtable_modelo_detallealmab.setValueAt(smin ,ii ,11);
                                }
                            ii=numerofilas;
                        }
                }
            }
         if (opcion==2)
            {
            for( ii=0;ii<numerofilas;ii++)
                {
                    mesactual=jtable_modelo_detallealmab.getValueAt(ii, 12).toString();
                     System.out.println("Agregando Historial:"+mesactual+" "+codigo);
                    if (mesactual.equals(codigo))
                        {
                            encontrado=1;
                            //hubica=this.jtable_modelo_detallealmab.getValueAt(ii,10).toString();
                            //jtable_modelo_detallealmab.setValueAt(existencia,ii ,columna);
                            if(columna==8)
                                {
                                    hubica=jtable_modelo_detallealmab.getValueAt(ii, 10).toString();
                                    jtable_modelo_detallealmab.setValueAt(hubica+":"+smin,ii ,10);
                                }
                            else
                                {
                                    hubica=jtable_modelo_detallealmab.getValueAt(ii, 11).toString();
                                    jtable_modelo_detallealmab.setValueAt(hubica+":"+smin ,ii ,11);
                                }
                            ii=numerofilas;
                        }
                }
            }
    }
private void carga_datos_fotospaginacion(int pagina)
    {
        textohtml="";
        String codigo[]=null;
        int nif=0,pag=pagina,nobjetotabla=this.jtable_modelo.getRowCount(),nip=0,ni=0,fila=0,artxpag=Integer.valueOf(this.jtf_fotosartxpag.getText().toString());
        float totalpaginas=this.jtable_modelo.getRowCount()/artxpag;

        this.jlbl_paginas.setText("PAGINAS :"+totalpaginas);
             nif=((pag+1)*artxpag);
             nip=((pag)*artxpag);
                        if (nif < nobjetotabla )
                            {
                                nobjetotabla=nif;
                            }
  System.out.println("filas x pagina"+artxpag+"tOTAL FILAS:"+this.jtable_modelo.getRowCount()+" PAGINA ACTUAL "+pagina+" filainicial "+ nip + " Fila Final"+ nobjetotabla);
                    /*Impresion de los productos*/
                        for(ni=nip;ni<nobjetotabla;ni++)
                        {
                            codigo=this.jtable_modelo.getValueAt(ni, 3).toString().split(":");
                            System.out.println(" fila Actual "+ ni );
                                if (fila<=0)
                                    {
                                    	textohtml+= "<tr>";
                                    }
                                    fila++;
                                    textohtml+="<th>"+codigo[1]+"<br>"+jtable_modelo.getValueAt(ni, 6).toString() + " $"+jtable_modelo.getValueAt(ni, 7).toString()+ "%Rot"+jtable_modelo.getValueAt(ni, 11).toString().replace("<html>", "").replace("</html>", "").replace("<BODY>", "").replace("</BODY>", "")+" "+"<br>"+"<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+codigo[1]+".JPG\" width=230 height=190 border=0 alt=\"Foto Articulo\" />"+"</th>";
                                 if (fila>=4)
                                    {
                                        textohtml+= "</tr>";
                                        fila=0;
                                    }
                        }
         this.jepn_fotos.setText("<html><head></head><body><table>"+textohtml+"</table></body></html>");
         System.out.println(" este es html "+ textohtml );
    }


 private void executabusqueda(int bus,int opbus,String busqueda)
 {
     float importe=0,importe2=0,acumulado=0,piezas=0,piezas2=0;
      DecimalFormat myForma = new DecimalFormat("############");
      DecimalFormat myForma2 = new DecimalFormat("############.##");
     String texto2="",htmlabre="<html><BODY>",htmlcierra="</BODY></html>",colorabre="",colorcierra="";
      textohtml="<tr><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th></tr>";
      int fila=0,banderafin=0;;
            if(this.jcbx_historialne.isSelected()==true)
                        {
                        }
                     else
                        {
                             while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);
                             while(jtable_modelo2.getRowCount()>0)jtable_modelo2.removeRow(0);
                             while(jtable_modelo_existencias.getRowCount()>0)jtable_modelo_existencias.removeRow(0);
                        }
                        if (this.jcbx_historialeti.isSelected()==true)
                        {}
                        else
                        {
                             while(jtable_modelo_etiq.getRowCount()>0)jtable_modelo_etiq.removeRow(0);
                        }

        Object[] fnewRow = new Object[12];
        Object[] fnewRowe = new Object[3];
        Object[] fnewRowet = new Object[6];
        String texto="select * from x1sieuno_articulo_catalogov3("+bus+","+opbus+",'"+busqueda+"') as (id integer, cla character varying(16),cod character varying(16), des character varying(80), ultimocosto numeric,fa integer,sub integer,it character varying(80),pre numeric, fe date, tei smallint,tev smallint,lineaarti smallint,controalmacen character varying(20),statusarticulo smallint,unidadempaque character varying(8),sublinea smallint,ob character varying(80),nomfa character varying(30), nomsub character varying(50),tementr character varying(25),descriplinea character varying(25),describestatus character varying(25),describesublinea character varying(25),describetemventa character varying(25),idbase character varying(16),descorta character varying(20),exis numeric,acumpzv numeric,acumimport numeric)";
        System.out.println("Catalogo "+texto);
       try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                    if (this.jcbx_costo.isSelected()==true)
                        {
                             fnewRow[1]=myForma2.format(rs.getFloat("ultimocosto"));
                        }
                    else
                        {
                             fnewRow[1]=rs.getString("nomfa");
                        }
                  fnewRow[0]=rs.getString("tementr");
                  
                  fnewRow[2]=rs.getString("nomsub")+"("+rs.getString("sub")+")";
                  fnewRow[3]=rs.getString("id")+":"+rs.getString("cla");
                  fnewRow[4]=rs.getString("des").replace("/", " ");
                  fnewRow[5]=rs.getString("it");
                  fnewRow[6]=rs.getString("descriplinea");
                  fnewRow[7]=rs.getString("pre");
                  fnewRow[8]=this.fechaeuropea(rs.getString ("fe"));
                  fnewRow[9]=myForma.format(rs.getFloat("acumpzv"));
                  fnewRow[10]=myForma.format(rs.getFloat("exis"));

                        piezas=rs.getFloat("acumpzv");
                        piezas2=rs.getFloat("exis");
                        acumulado=piezas+piezas2;
                        importe=(piezas/acumulado)*100;
                        colorabre="";
                        colorcierra="";
                        if (importe<=50)
                            {
                                colorabre="<b><font color=#CC0000>";
                                colorcierra="<font></b>";
                            }
                        if ((importe>50) && (importe<=75))
                            {
                                colorabre="<b><font color=#0000FF>";
                                colorcierra="<font></b>";
                            }
                        if (importe>75)
                            {
                                colorabre="<b><font color=#00FF00>";
                                colorcierra="<font></b>";
                            }
                  fnewRow[11]=htmlabre+colorabre+myForma.format(importe)+"%"+colorcierra+htmlcierra;
                  jtable_modelo.addRow(fnewRow);
                  jtable_modelo2.addRow(fnewRow);
                  
                  fnewRowe[0]=rs.getString("cla");
                  fnewRowe[1]=rs.getString("id")+":"+rs.getString ("des");
                  fnewRowe[2]=rs.getString("it")+".";
                  jtable_modelo_existencias.addRow(fnewRowe);
                  fnewRowet[0]=rs.getString("cla");
                  fnewRowet[1]=rs.getString("cod");
                  fnewRowet[2]=rs.getString("des");
                  fnewRowet[3]=rs.getString("it");
                  fnewRowet[4]=rs.getString("pre");
                  fnewRowet[5]=this.jtf_cantidadeti.getText();
                  jtable_modelo_etiq.addRow(fnewRowet);
                  banderafin=1;
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
        this.jlbl_cantidadregistros.setText(String.valueOf(this.jtable_modelo.getRowCount()));
        this.jlbl_textobuscado.setText(this.jtf_busqueda.getText().toUpperCase().trim());

    if(banderafin==0)
         {
           JOptionPane.showMessageDialog(null,"Clave:"+busqueda+" No Encontrado", "Sistema Integral(Modificar articulo) : Ayuda",1);
         }
 }
private void executabusquedayorigen(int bus,int opbus,String busqueda)
 {
     float importe=0,importe2=0,acumulado=0,piezas=0,piezas2=0;
      DecimalFormat myForma = new DecimalFormat("############");
      DecimalFormat myForma2 = new DecimalFormat("############.##");
     String texto2="",htmlabre="<html><BODY>",htmlcierra="</BODY></html>",colorabre="",colorcierra="";
      textohtml="<tr><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th><th>Clave Articulo/Descripcion/foto</th></tr>";
      int fila=0,banderafin=0;;
            if(this.jcbx_historialne.isSelected()==true)
                        {
                        }
                     else
                        {
                             while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);
                             while(jtable_modelo2.getRowCount()>0)jtable_modelo2.removeRow(0);
                             while(jtable_modelo_existencias.getRowCount()>0)jtable_modelo_existencias.removeRow(0);
                        }
                        if (this.jcbx_historialeti.isSelected()==true)
                        {}
                        else
                        {
                             while(jtable_modelo_etiq.getRowCount()>0)jtable_modelo_etiq.removeRow(0);
                        }

        Object[] fnewRow = new Object[12];
        Object[] fnewRowe = new Object[3];
        Object[] fnewRowet = new Object[6];
        String texto="select * from x1sieuno_articulo_catalogov4("+bus+","+opbus+",'"+busqueda+"') as (id integer, cla character varying(16),cod character varying(16), des character varying(80), ultimocosto numeric,fa integer,sub integer,it character varying(80),pre numeric, fe date, tei smallint,tev smallint,lineaarti smallint,controalmacen character varying(20),statusarticulo smallint,unidadempaque character varying(8),sublinea smallint,ob character varying(80),nomfa character varying(30), nomsub character varying(50),tementr character varying(25),descriplinea character varying(25),describestatus character varying(25),describesublinea character varying(25),describetemventa character varying(25),idbase character varying(16),descorta character varying(20),exis numeric,acumpzv numeric,acumimport numeric,clasif character varying(40))";
        System.out.println("Catalogo "+texto);
       try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                    if (this.jcbx_costo.isSelected()==true)
                        {
                             fnewRow[1]=myForma2.format(rs.getFloat("ultimocosto"));
                        }
                    else
                        {
                             fnewRow[1]=rs.getString("nomfa");
                        }
                  fnewRow[0]=rs.getString("tementr");

                  fnewRow[2]=rs.getString("nomsub")+"("+rs.getString("sub")+")";
                  fnewRow[3]=rs.getString("id")+":"+rs.getString("cla");
                  fnewRow[4]=rs.getString("des").replace("/", " ");
                  fnewRow[5]=rs.getString("it");
                  fnewRow[6]=rs.getString("clasif");
                  fnewRow[7]=rs.getString("pre");
                  fnewRow[8]=this.fechaeuropea(rs.getString ("fe"));
                  fnewRow[9]=myForma.format(rs.getFloat("acumpzv"));
                  fnewRow[10]=myForma.format(rs.getFloat("exis"));

                        piezas=rs.getFloat("acumpzv");
                        piezas2=rs.getFloat("exis");
                        acumulado=piezas+piezas2;
                        importe=(piezas/acumulado)*100;
                        colorabre="";
                        colorcierra="";
                        if (importe<=50)
                            {
                                colorabre="<b><font color=#CC0000>";
                                colorcierra="<font></b>";
                            }
                        if ((importe>50) && (importe<=75))
                            {
                                colorabre="<b><font color=#0000FF>";
                                colorcierra="<font></b>";
                            }
                        if (importe>75)
                            {
                                colorabre="<b><font color=#00FF00>";
                                colorcierra="<font></b>";
                            }
                  fnewRow[11]=htmlabre+colorabre+myForma.format(importe)+"%"+colorcierra+htmlcierra;
                  jtable_modelo.addRow(fnewRow);
                  jtable_modelo2.addRow(fnewRow);

                  fnewRowe[0]=rs.getString("cla");
                  fnewRowe[1]=rs.getString("id")+":"+rs.getString ("des");
                  fnewRowe[2]=rs.getString("it")+".";
                  jtable_modelo_existencias.addRow(fnewRowe);
                  fnewRowet[0]=rs.getString("cla");
                  fnewRowet[1]=rs.getString("cod");
                  fnewRowet[2]=rs.getString("des");
                  fnewRowet[3]=rs.getString("it");
                  fnewRowet[4]=rs.getString("pre");
                  fnewRowet[5]=this.jtf_cantidadeti.getText();
                  jtable_modelo_etiq.addRow(fnewRowet);
                  banderafin=1;
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
        this.jlbl_cantidadregistros.setText(String.valueOf(this.jtable_modelo.getRowCount()));
        this.jlbl_textobuscado.setText(this.jtf_busqueda.getText().toUpperCase().trim());

    if(banderafin==0)
         {
           JOptionPane.showMessageDialog(null,"Clave:"+busqueda+" No Encontrado", "Sistema Integral(Modificar articulo) : Ayuda",1);
         }
 }
private void executabusquedapromogen(int bus,int opbus,String busqueda)
 {
     float importe=0,importe2=0,acumulado=0,piezas=0,piezas2=0;
      DecimalFormat myForma = new DecimalFormat("############");
      DecimalFormat myForma2 = new DecimalFormat("############.##");
                             while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);

        Object[] fnewRow = new Object[12];

        String texto="select * from x1sieuno_articulo_catalogov4("+bus+","+opbus+",'"+busqueda+"') as (id integer, cla character varying(16),cod character varying(16), des character varying(80), ultimocosto numeric,fa integer,sub integer,it character varying(80),pre numeric, fe date, tei smallint,tev smallint,lineaarti smallint,controalmacen character varying(20),statusarticulo smallint,unidadempaque character varying(8),sublinea smallint,ob character varying(80),nomfa character varying(30), nomsub character varying(50),tementr character varying(25),descriplinea character varying(25),describestatus character varying(25),describesublinea character varying(25),describetemventa character varying(25),idbase character varying(16),descorta character varying(20),exis numeric,acumpzv numeric,acumimport numeric,aux text,idviaje smallint)";
        System.out.println("Catalogo "+texto);
       try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                    if (this.jcbx_costo.isSelected()==true)
                        {
                             fnewRow[1]=myForma2.format(rs.getFloat("ultimocosto"));
                        }
                    else
                        {
                             fnewRow[1]=rs.getString("nomfa");
                        }
                  fnewRow[0]=rs.getString("tementr");

                  fnewRow[2]=rs.getString("nomsub")+"("+rs.getString("sub")+")";
                  fnewRow[3]=rs.getString("id")+":"+rs.getString("cla");
                  fnewRow[4]=rs.getString("des").replace("/", " ");
                  fnewRow[5]=rs.getString("it");
                  fnewRow[6]=rs.getString("descriplinea");
                  fnewRow[7]=rs.getString("pre");
                  fnewRow[8]=this.fechaeuropea(rs.getString ("fe"));
                  fnewRow[9]=myForma.format(rs.getFloat("acumpzv"));
                  fnewRow[10]=myForma.format(rs.getFloat("exis"));

                  fnewRow[11]=rs.getString("aux");
                  jtable_modelo.addRow(fnewRow);

                 
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
        this.jlbl_cantidadregistros.setText(String.valueOf(this.jtable_modelo.getRowCount()));
        this.jlbl_textobuscado.setText(this.jtf_busqueda.getText().toUpperCase().trim());

 }
 private void carga_datos_promosug(int bus,String busqueda)
 {
      Object[] fnewRowf = new Object[5];
      DecimalFormat miformat = new DecimalFormat("############.##");
      while(jtable_modelo_prosug.getRowCount()>0)jtable_modelo_prosug.removeRow(0);
      String texto="select * from x1sieuno_articulo_promociones_detalle(6,'"+busqueda+"') as (idreg integer,idpro integer,clavearticulo character varying(16), des character varying(80), pre numeric,fei date,hora time,tienda text)";
        System.out.println("detalle:"+texto);
       try
        {
            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                  fnewRowf[0]=rs.getString("clavearticulo");
                  fnewRowf[1]=rs.getString("idpro")+":"+rs.getString("des");
                  fnewRowf[2]=""+miformat.format(rs.getFloat("pre"))+"";
                  fnewRowf[3]=this.fechaeuropea(rs.getString("fei"));
                  fnewRowf[4]=rs.getString("tienda");
                  jtable_modelo_prosug.addRow(fnewRowf);
                }
       }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }

    //this.registrosobtenidos();
    //this.cambiartamanofilas();
       this.verexistencias();
 }

 private void cargar_datos_viaje(int opcion, int opbuscamp,String busqueda)
    {
      //se crea intancia de la clase conexion

      Object[] fnewRow = new Object[15];

       String texto="select * from x1distribucion_terminados_viajes("+opcion+","+opbuscamp+",'"+busqueda+"') as (id integer,descripclasif character varying(30),inicial character varying(3))";
       try
         {
           rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
            while (rs.next())
                {
                    this.jcbx_viajes.addItem(rs.getString ("id")+":"+rs.getString ("descripclasif"))
                            ;

                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }
controlcombo2=1;
}
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        buttonGroup3 = new javax.swing.ButtonGroup();
        driver1 = new org.postgresql.Driver();
        buttonGroup4 = new javax.swing.ButtonGroup();
        buttonGroup5 = new javax.swing.ButtonGroup();
        jPanel1 = new javax.swing.JPanel();
        jrb_bclave = new javax.swing.JRadioButton();
        jrb_bdescrip = new javax.swing.JRadioButton();
        jtf_busqueda = new javax.swing.JTextField();
        jbtn_buscar = new javax.swing.JButton();
        jrb_bitem = new javax.swing.JRadioButton();
        jrb_bprecio = new javax.swing.JRadioButton();
        jrb_obexacto = new javax.swing.JRadioButton();
        jrb_obcomienza = new javax.swing.JRadioButton();
        jrb_obaniway = new javax.swing.JRadioButton();
        jrb_bidfam = new javax.swing.JRadioButton();
        jrb_bidsubfam = new javax.swing.JRadioButton();
        jrb_bdessubfam = new javax.swing.JRadioButton();
        jrbtn_idarticulo = new javax.swing.JRadioButton();
        jbtn_tendresuerte = new javax.swing.JButton();
        jcbx_historialne = new javax.swing.JCheckBox();
        jScrollPane4 = new javax.swing.JScrollPane();
        jta_archivo = new javax.swing.JTextArea();
        jrb_linea = new javax.swing.JRadioButton();
        jPanel2 = new javax.swing.JPanel();
        jbtn_salir = new javax.swing.JButton();
        jbtn_add_art = new javax.swing.JButton();
        jbtn_generorequisicion = new javax.swing.JButton();
        jtb_inveprogramados = new javax.swing.JButton();
        jbtn_traspasos = new javax.swing.JButton();
        jbtn_movimientosalmacen = new javax.swing.JButton();
        jbtn_articulospromocion = new javax.swing.JButton();
        jbtn_salir1 = new javax.swing.JButton();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jtb_catalogo_articulos = new javax.swing.JTable(){
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }}
            ;
            jLabel4 = new javax.swing.JLabel();
            jlbl_textobuscado = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            jlbl_cantidadregistros = new javax.swing.JLabel();
            jLabel5 = new javax.swing.JLabel();
            jtf_idarticulocat = new javax.swing.JTextField();
            jcbx_costo = new javax.swing.JCheckBox();
            jcbx_costo1 = new javax.swing.JCheckBox();
            jPanel4 = new javax.swing.JPanel();
            jchbx_verexistencias = new javax.swing.JCheckBox();
            jPanel8 = new javax.swing.JPanel();
            jScrollPane11 = new javax.swing.JScrollPane();
            jep_articuloimagen = new javax.swing.JEditorPane();
            jPanel6 = new javax.swing.JPanel();
            jScrollPane2 = new javax.swing.JScrollPane();
            jtb_catalogo_artiexis = new javax.swing.JTable(){
                public boolean isCellEditable(int rowIndex, int mColIndex) {
                    return false;
                }}
                ;
                jtf_idarticulo_exi = new javax.swing.JTextField();
                jbtn_imagenfull = new javax.swing.JButton();
                jrbtn_evgen = new javax.swing.JRadioButton();
                jrbtn_existencia = new javax.swing.JRadioButton();
                jtf_idarticulo_exi2 = new javax.swing.JTextField();
                jPanel5 = new javax.swing.JPanel();
                jScrollPane3 = new javax.swing.JScrollPane();
                jepn_fotos = new javax.swing.JEditorPane();
                jcbx_catalgoimagenes = new javax.swing.JCheckBox();
                jlbl_paginas = new javax.swing.JLabel();
                jbtn_anterior = new javax.swing.JButton();
                jbtn_siguiente = new javax.swing.JButton();
                jtf_paginaactual = new javax.swing.JTextField();
                jtf_fotosartxpag = new javax.swing.JTextField();
                jPanel7 = new javax.swing.JPanel();
                jScrollPane5 = new javax.swing.JScrollPane();
                jtb_catalogo_articulos1 = new javax.swing.JTable(){
                    public boolean isCellEditable(int rowIndex, int mColIndex) {
                        if(mColIndex>4)
                        return true;
                        else
                        return false;
                    }}
                    ;
                    jcbx_historialeti = new javax.swing.JCheckBox();
                    jbtn_generaeti = new javax.swing.JButton();
                    jtf_unidad = new javax.swing.JTextField();
                    jLabel1 = new javax.swing.JLabel();
                    jLabel19 = new javax.swing.JLabel();
                    jtf_cantidadeti = new javax.swing.JTextField();
                    jPanel9 = new javax.swing.JPanel();
                    jScrollPane6 = new javax.swing.JScrollPane();
                    jtb_catalogo_articulos2 = new javax.swing.JTable(){
                        public boolean isCellEditable(int rowIndex, int mColIndex) {
                            return false;
                        }}
                        ;
                        jScrollPane7 = new javax.swing.JScrollPane();
                        jtb_catalogo_articulos3 = new javax.swing.JTable(){
                            public boolean isCellEditable(int rowIndex, int mColIndex) {
                                return false;
                            }}
                            ;
                            jPanel10 = new javax.swing.JPanel();
                            jtf_idproductopromo = new javax.swing.JTextField();
                            jbtn_promocionsugerencia = new javax.swing.JButton();
                            jScrollPane8 = new javax.swing.JScrollPane();
                            jt_catempleados1 = new javax.swing.JTable()
                            {
                                public boolean isCellEditable(int rowIndex, int mColIndex) {
                                    return false;
                                }
                            }
                            ;
                            jtf_idartsug = new javax.swing.JTextField();
                            jLabel6 = new javax.swing.JLabel();
                            jLabel7 = new javax.swing.JLabel();
                            jlbl_cantidadregistros1 = new javax.swing.JLabel();
                            jLabel8 = new javax.swing.JLabel();
                            jPanel11 = new javax.swing.JPanel();
                            jPanel12 = new javax.swing.JPanel();
                            jScrollPane14 = new javax.swing.JScrollPane();
                            jtbl_articulosentiendas1 = new javax.swing.JTable(){
                                public boolean isCellEditable(int rowIndex, int mColIndex) {
                                    return false;
                                }}
                                ;
                                jtf_tiendaarti1 = new javax.swing.JTextField();
                                id_tienda = new javax.swing.JTextField();
                                id_tienda1 = new javax.swing.JTextField();
                                jLabel9 = new javax.swing.JLabel();
                                jcbx_tiendas = new javax.swing.JComboBox();
                                jScrollPane17 = new javax.swing.JScrollPane();
                                jlst_clientesdistribucion2 = new javax.swing.JList();
                                jScrollPane18 = new javax.swing.JScrollPane();
                                jlst_clientesdistribucion3 = new javax.swing.JList();
                                jtf_tiendaarti2 = new javax.swing.JTextField();
                                jrbtn_modoactualizacion = new javax.swing.JRadioButton();
                                jbtn_modoactulizacon = new javax.swing.JRadioButton();
                                jtf_preciotienda = new javax.swing.JTextField();
                                jLabel11 = new javax.swing.JLabel();
                                jtf_preciobodega = new javax.swing.JTextField();
                                jLabel12 = new javax.swing.JLabel();
                                jButton3 = new javax.swing.JButton();
                                jScrollPane12 = new javax.swing.JScrollPane();
                                jep_articuloimagen1 = new javax.swing.JEditorPane();
                                jcbx_viajes = new javax.swing.JComboBox();
                                jLabel13 = new javax.swing.JLabel();
                                jrbtn_modoactualizacion1 = new javax.swing.JRadioButton();
                                jtf_idarticulo_exi1 = new javax.swing.JTextField();
                                jbtn_ubicacionquitar = new javax.swing.JButton();
                                jScrollPane19 = new javax.swing.JScrollPane();
                                jlst_clientesdistribucion4 = new javax.swing.JList();
                                jMenuBar1 = new javax.swing.JMenuBar();
                                jMenu1 = new javax.swing.JMenu();
                                jMenuItem2 = new javax.swing.JMenuItem();
                                jMenuItem4 = new javax.swing.JMenuItem();
                                jMenuItem7 = new javax.swing.JMenuItem();
                                jmni_salir = new javax.swing.JMenuItem();
                                jMenu2 = new javax.swing.JMenu();
                                jMenuItem1 = new javax.swing.JMenuItem();
                                jMenuItem3 = new javax.swing.JMenuItem();
                                jmni_escape = new javax.swing.JMenuItem();
                                jmni_tenersuerte = new javax.swing.JMenuItem();
                                jmni_importar = new javax.swing.JMenuItem();
                                jMenuItem6 = new javax.swing.JMenuItem();
                                jMenuItem5 = new javax.swing.JMenuItem();
                                jMenuItem8 = new javax.swing.JMenuItem();
                                jmni_revpro = new javax.swing.JMenuItem();
                                jmni_menu = new javax.swing.JMenuItem();
                                jMenuItem10 = new javax.swing.JMenuItem();
                                jMenu4 = new javax.swing.JMenu();
                                jMenuItem9 = new javax.swing.JMenuItem();
                                jmni_altareclasif = new javax.swing.JMenuItem();
                                jmni_altadefectuoso = new javax.swing.JMenuItem();
                                jMenu3 = new javax.swing.JMenu();
                                jmn_help = new javax.swing.JMenuItem();
                                jmni_creacomentario = new javax.swing.JMenuItem();

                                setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
                                org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(sie_invdis.Sie_invdisApp.class).getContext().getResourceMap(articulos_sie_catalogo.class);
                                setTitle(resourceMap.getString("Form.title")); // NOI18N
                                setName("Form"); // NOI18N
                                addFocusListener(new java.awt.event.FocusAdapter() {
                                    public void focusGained(java.awt.event.FocusEvent evt) {
                                        formFocusGained(evt);
                                    }
                                });

                                jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel1.border.title"))); // NOI18N
                                jPanel1.setName("jPanel1"); // NOI18N

                                buttonGroup1.add(jrb_bclave);
                                jrb_bclave.setText(resourceMap.getString("jrb_bclave.text")); // NOI18N
                                jrb_bclave.setToolTipText(resourceMap.getString("jrb_bclave.toolTipText")); // NOI18N
                                jrb_bclave.setActionCommand(resourceMap.getString("jrb_bclave.actionCommand")); // NOI18N
                                jrb_bclave.setName("jrb_bclave"); // NOI18N
                                jrb_bclave.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrb_bclaveActionPerformed(evt);
                                    }
                                });

                                buttonGroup1.add(jrb_bdescrip);
                                jrb_bdescrip.setText(resourceMap.getString("jrb_bdescrip.text")); // NOI18N
                                jrb_bdescrip.setToolTipText(resourceMap.getString("jrb_bdescrip.toolTipText")); // NOI18N
                                jrb_bdescrip.setActionCommand(resourceMap.getString("jrb_bdescrip.actionCommand")); // NOI18N
                                jrb_bdescrip.setName("jrb_bdescrip"); // NOI18N
                                jrb_bdescrip.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrb_bdescripActionPerformed(evt);
                                    }
                                });

                                jtf_busqueda.setText(resourceMap.getString("jtf_busqueda.text")); // NOI18N
                                jtf_busqueda.setToolTipText(resourceMap.getString("jtf_busqueda.toolTipText")); // NOI18N
                                jtf_busqueda.setName("jtf_busqueda"); // NOI18N
                                jtf_busqueda.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jtf_busquedaActionPerformed(evt);
                                    }
                                });

                                jbtn_buscar.setIcon(resourceMap.getIcon("jbtn_buscar.icon")); // NOI18N
                                jbtn_buscar.setText(resourceMap.getString("jbtn_buscar.text")); // NOI18N
                                jbtn_buscar.setName("jbtn_buscar"); // NOI18N
                                jbtn_buscar.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_buscarActionPerformed(evt);
                                    }
                                });

                                buttonGroup1.add(jrb_bitem);
                                jrb_bitem.setText(resourceMap.getString("jrb_bitem.text")); // NOI18N
                                jrb_bitem.setToolTipText(resourceMap.getString("jrb_bitem.toolTipText")); // NOI18N
                                jrb_bitem.setActionCommand(resourceMap.getString("jrb_bitem.actionCommand")); // NOI18N
                                jrb_bitem.setName("jrb_bitem"); // NOI18N
                                jrb_bitem.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrb_bitemActionPerformed(evt);
                                    }
                                });

                                buttonGroup1.add(jrb_bprecio);
                                jrb_bprecio.setText(resourceMap.getString("jrb_bprecio.text")); // NOI18N
                                jrb_bprecio.setToolTipText(resourceMap.getString("jrb_bprecio.toolTipText")); // NOI18N
                                jrb_bprecio.setActionCommand(resourceMap.getString("jrb_bprecio.actionCommand")); // NOI18N
                                jrb_bprecio.setName("jrb_bprecio"); // NOI18N
                                jrb_bprecio.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrb_bprecioActionPerformed(evt);
                                    }
                                });

                                buttonGroup2.add(jrb_obexacto);
                                jrb_obexacto.setText(resourceMap.getString("jrb_obexacto.text")); // NOI18N
                                jrb_obexacto.setToolTipText(resourceMap.getString("jrb_obexacto.toolTipText")); // NOI18N
                                jrb_obexacto.setActionCommand(resourceMap.getString("jrb_obexacto.actionCommand")); // NOI18N
                                jrb_obexacto.setName("jrb_obexacto"); // NOI18N
                                jrb_obexacto.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrb_obexactoActionPerformed(evt);
                                    }
                                });

                                buttonGroup2.add(jrb_obcomienza);
                                jrb_obcomienza.setText(resourceMap.getString("jrb_obcomienza.text")); // NOI18N
                                jrb_obcomienza.setToolTipText(resourceMap.getString("jrb_obcomienza.toolTipText")); // NOI18N
                                jrb_obcomienza.setActionCommand(resourceMap.getString("jrb_obcomienza.actionCommand")); // NOI18N
                                jrb_obcomienza.setName("jrb_obcomienza"); // NOI18N
                                jrb_obcomienza.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrb_obcomienzaActionPerformed(evt);
                                    }
                                });

                                buttonGroup2.add(jrb_obaniway);
                                jrb_obaniway.setText(resourceMap.getString("jrb_obaniway.text")); // NOI18N
                                jrb_obaniway.setToolTipText(resourceMap.getString("jrb_obaniway.toolTipText")); // NOI18N
                                jrb_obaniway.setActionCommand(resourceMap.getString("jrb_obaniway.actionCommand")); // NOI18N
                                jrb_obaniway.setName("jrb_obaniway"); // NOI18N
                                jrb_obaniway.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrb_obaniwayActionPerformed(evt);
                                    }
                                });

                                buttonGroup1.add(jrb_bidfam);
                                jrb_bidfam.setText(resourceMap.getString("jrb_bidfam.text")); // NOI18N
                                jrb_bidfam.setToolTipText(resourceMap.getString("jrb_bidfam.toolTipText")); // NOI18N
                                jrb_bidfam.setActionCommand(resourceMap.getString("jrb_bidfam.actionCommand")); // NOI18N
                                jrb_bidfam.setName("jrb_bidfam"); // NOI18N
                                jrb_bidfam.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrb_bidfamActionPerformed(evt);
                                    }
                                });

                                buttonGroup1.add(jrb_bidsubfam);
                                jrb_bidsubfam.setText(resourceMap.getString("jrb_bidsubfam.text")); // NOI18N
                                jrb_bidsubfam.setToolTipText(resourceMap.getString("jrb_bidsubfam.toolTipText")); // NOI18N
                                jrb_bidsubfam.setActionCommand(resourceMap.getString("jrb_bidsubfam.actionCommand")); // NOI18N
                                jrb_bidsubfam.setName("jrb_bidsubfam"); // NOI18N
                                jrb_bidsubfam.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrb_bidsubfamActionPerformed(evt);
                                    }
                                });

                                buttonGroup1.add(jrb_bdessubfam);
                                jrb_bdessubfam.setText(resourceMap.getString("jrb_bdessubfam.text")); // NOI18N
                                jrb_bdessubfam.setToolTipText(resourceMap.getString("jrb_bdessubfam.toolTipText")); // NOI18N
                                jrb_bdessubfam.setActionCommand(resourceMap.getString("jrb_bdessubfam.actionCommand")); // NOI18N
                                jrb_bdessubfam.setName("jrb_bdessubfam"); // NOI18N
                                jrb_bdessubfam.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrb_bdessubfamActionPerformed(evt);
                                    }
                                });

                                buttonGroup1.add(jrbtn_idarticulo);
                                jrbtn_idarticulo.setText(resourceMap.getString("jrbtn_idarticulo.text")); // NOI18N
                                jrbtn_idarticulo.setActionCommand(resourceMap.getString("jrbtn_idarticulo.actionCommand")); // NOI18N
                                jrbtn_idarticulo.setName("jrbtn_idarticulo"); // NOI18N
                                jrbtn_idarticulo.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrbtn_idarticuloActionPerformed(evt);
                                    }
                                });

                                jbtn_tendresuerte.setText(resourceMap.getString("jbtn_tendresuerte.text")); // NOI18N
                                jbtn_tendresuerte.setName("jbtn_tendresuerte"); // NOI18N
                                jbtn_tendresuerte.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_tendresuerteActionPerformed(evt);
                                    }
                                });

                                jcbx_historialne.setText(resourceMap.getString("jcbx_historialne.text")); // NOI18N
                                jcbx_historialne.setName("jcbx_historialne"); // NOI18N
                                jcbx_historialne.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jcbx_historialneActionPerformed(evt);
                                    }
                                });

                                jScrollPane4.setName("jScrollPane4"); // NOI18N

                                jta_archivo.setColumns(20);
                                jta_archivo.setRows(5);
                                jta_archivo.setName("jta_archivo"); // NOI18N
                                jScrollPane4.setViewportView(jta_archivo);

                                buttonGroup1.add(jrb_linea);
                                jrb_linea.setText(resourceMap.getString("jrb_linea.text")); // NOI18N
                                jrb_linea.setToolTipText(resourceMap.getString("jrb_linea.toolTipText")); // NOI18N
                                jrb_linea.setActionCommand(resourceMap.getString("jrb_linea.actionCommand")); // NOI18N
                                jrb_linea.setName("jrb_linea"); // NOI18N
                                jrb_linea.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrb_lineaActionPerformed(evt);
                                    }
                                });

                                javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
                                jPanel1.setLayout(jPanel1Layout);
                                jPanel1Layout.setHorizontalGroup(
                                    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGap(76, 76, 76)
                                        .addComponent(jrb_linea)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addComponent(jrb_bclave)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jrb_bdescrip)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jrb_bitem)
                                                .addGap(4, 4, 4)
                                                .addComponent(jrb_bprecio)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jrb_bidfam)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jrb_bidsubfam)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jrb_bdessubfam)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jrbtn_idarticulo)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addComponent(jcbx_historialne))
                                            .addGroup(jPanel1Layout.createSequentialGroup()
                                                .addComponent(jrb_obexacto)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jrb_obcomienza)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jrb_obaniway)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jtf_busqueda, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(33, 33, 33)
                                                .addComponent(jbtn_buscar, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(18, 18, 18)
                                                .addComponent(jbtn_tendresuerte, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                );
                                jPanel1Layout.setVerticalGroup(
                                    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jrb_obcomienza)
                                            .addComponent(jbtn_buscar)
                                            .addComponent(jtf_busqueda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jrb_obaniway)
                                            .addComponent(jrb_obexacto)
                                            .addComponent(jbtn_tendresuerte))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jrb_bclave)
                                            .addComponent(jrb_bdescrip)
                                            .addComponent(jrb_bprecio)
                                            .addComponent(jrb_bitem)
                                            .addComponent(jrb_bidfam)
                                            .addComponent(jrb_bidsubfam)
                                            .addComponent(jrb_bdessubfam)
                                            .addComponent(jrbtn_idarticulo)
                                            .addComponent(jcbx_historialne)
                                            .addComponent(jrb_linea)))
                                    .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)
                                );

                                jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
                                jPanel2.setName("jPanel2"); // NOI18N

                                jbtn_salir.setIcon(resourceMap.getIcon("jbtn_salir.icon")); // NOI18N
                                jbtn_salir.setText(resourceMap.getString("jbtn_salir.text")); // NOI18N
                                jbtn_salir.setName("jbtn_salir"); // NOI18N
                                jbtn_salir.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_salirActionPerformed(evt);
                                    }
                                });

                                jbtn_add_art.setIcon(resourceMap.getIcon("jbtn_add_art.icon")); // NOI18N
                                jbtn_add_art.setText(resourceMap.getString("jbtn_add_art.text")); // NOI18N
                                jbtn_add_art.setName("jbtn_add_art"); // NOI18N
                                jbtn_add_art.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_add_artActionPerformed(evt);
                                    }
                                });

                                jbtn_generorequisicion.setIcon(resourceMap.getIcon("jbtn_generorequisicion.icon")); // NOI18N
                                jbtn_generorequisicion.setText(resourceMap.getString("jbtn_generorequisicion.text")); // NOI18N
                                jbtn_generorequisicion.setName("jbtn_generorequisicion"); // NOI18N
                                jbtn_generorequisicion.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_generorequisicionActionPerformed(evt);
                                    }
                                });

                                jtb_inveprogramados.setText(resourceMap.getString("jtb_inveprogramados.text")); // NOI18N
                                jtb_inveprogramados.setName("jtb_inveprogramados"); // NOI18N
                                jtb_inveprogramados.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jtb_inveprogramadosActionPerformed(evt);
                                    }
                                });

                                jbtn_traspasos.setIcon(resourceMap.getIcon("jbtn_traspasos.icon")); // NOI18N
                                jbtn_traspasos.setText(resourceMap.getString("jbtn_traspasos.text")); // NOI18N
                                jbtn_traspasos.setName("jbtn_traspasos"); // NOI18N
                                jbtn_traspasos.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_traspasosActionPerformed(evt);
                                    }
                                });

                                jbtn_movimientosalmacen.setIcon(resourceMap.getIcon("jbtn_movimientosalmacen.icon")); // NOI18N
                                jbtn_movimientosalmacen.setText(resourceMap.getString("jbtn_movimientosalmacen.text")); // NOI18N
                                jbtn_movimientosalmacen.setName("jbtn_movimientosalmacen"); // NOI18N
                                jbtn_movimientosalmacen.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_movimientosalmacenActionPerformed(evt);
                                    }
                                });

                                jbtn_articulospromocion.setIcon(resourceMap.getIcon("jbtn_articulospromocion.icon")); // NOI18N
                                jbtn_articulospromocion.setText(resourceMap.getString("jbtn_articulospromocion.text")); // NOI18N
                                jbtn_articulospromocion.setName("jbtn_articulospromocion"); // NOI18N
                                jbtn_articulospromocion.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_articulospromocionActionPerformed(evt);
                                    }
                                });

                                jbtn_salir1.setIcon(resourceMap.getIcon("jbtn_salir1.icon")); // NOI18N
                                jbtn_salir1.setText(resourceMap.getString("jbtn_salir1.text")); // NOI18N
                                jbtn_salir1.setToolTipText(resourceMap.getString("jbtn_salir1.toolTipText")); // NOI18N
                                jbtn_salir1.setName("jbtn_salir1"); // NOI18N
                                jbtn_salir1.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_salir1ActionPerformed(evt);
                                    }
                                });

                                javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
                                jPanel2.setLayout(jPanel2Layout);
                                jPanel2Layout.setHorizontalGroup(
                                    jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addComponent(jbtn_add_art, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jbtn_traspasos, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jbtn_generorequisicion)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jtb_inveprogramados)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jbtn_movimientosalmacen)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jbtn_articulospromocion)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jbtn_salir1, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38, Short.MAX_VALUE)
                                        .addComponent(jbtn_salir, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE))
                                );
                                jPanel2Layout.setVerticalGroup(
                                    jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel2Layout.createSequentialGroup()
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jbtn_add_art)
                                            .addComponent(jbtn_traspasos)
                                            .addComponent(jbtn_generorequisicion)
                                            .addComponent(jtb_inveprogramados)
                                            .addComponent(jbtn_movimientosalmacen)
                                            .addComponent(jbtn_articulospromocion)
                                            .addComponent(jbtn_salir)
                                            .addComponent(jbtn_salir1))
                                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                );

                                jTabbedPane1.setName("jTabbedPane1"); // NOI18N
                                jTabbedPane1.addChangeListener(new javax.swing.event.ChangeListener() {
                                    public void stateChanged(javax.swing.event.ChangeEvent evt) {
                                        jTabbedPane1StateChanged(evt);
                                    }
                                });

                                jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
                                jPanel3.setName("jPanel3"); // NOI18N

                                jScrollPane1.setName("jScrollPane1"); // NOI18N

                                jtb_catalogo_articulos.setModel(this.jtable_modelo);
                                jtb_catalogo_articulos.setName("jtb_catalogo_articulos"); // NOI18N
                                jtb_catalogo_articulos.addMouseListener(new java.awt.event.MouseAdapter() {
                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                        if(evt.getClickCount() >= 1)
                                        {
                                            dioclickfoto(evt);
                                            //System.out.println(" double click" );

                                        }
                                        if(evt.getClickCount() >= 2)
                                        {
                                            dioclick(evt);
                                            //System.out.println(" double click" );

                                        }
                                    }
                                });
                                jtb_catalogo_articulos.addKeyListener(new java.awt.event.KeyAdapter() {
                                    public void keyPressed(java.awt.event.KeyEvent evt) {
                                        jtb_catalogo_articulosKeyPressed(evt);
                                    }
                                });
                                jtb_catalogo_articulos.addMouseListener(new java.awt.event.MouseAdapter() {
                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                        jtb_catalogo_articulosMouseClicked(evt);
                                    }
                                });
                                jtb_catalogo_articulos.setRowHeight(26);
                                jtb_catalogo_articulos.addMouseListener(new java.awt.event.MouseAdapter() {
                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                        jtb_catalogo_articulosMouseClicked(evt);
                                    }
                                });
                                jtb_catalogo_articulos.addKeyListener(new java.awt.event.KeyAdapter() {
                                    public void keyPressed(java.awt.event.KeyEvent evt) {
                                        jtb_catalogo_articulosKeyPressed(evt);
                                    }
                                });
                                jScrollPane1.setViewportView(jtb_catalogo_articulos);

                                jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
                                jLabel4.setName("jLabel4"); // NOI18N

                                jlbl_textobuscado.setFont(resourceMap.getFont("jlbl_textobuscado.font")); // NOI18N
                                jlbl_textobuscado.setText(resourceMap.getString("jlbl_textobuscado.text")); // NOI18N
                                jlbl_textobuscado.setName("jlbl_textobuscado"); // NOI18N

                                jLabel3.setFont(resourceMap.getFont("jLabel3.font")); // NOI18N
                                jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
                                jLabel3.setName("jLabel3"); // NOI18N

                                jlbl_cantidadregistros.setFont(resourceMap.getFont("jlbl_cantidadregistros.font")); // NOI18N
                                jlbl_cantidadregistros.setText(resourceMap.getString("jlbl_cantidadregistros.text")); // NOI18N
                                jlbl_cantidadregistros.setName("jlbl_cantidadregistros"); // NOI18N

                                jLabel5.setFont(resourceMap.getFont("jLabel5.font")); // NOI18N
                                jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
                                jLabel5.setName("jLabel5"); // NOI18N

                                jtf_idarticulocat.setFont(resourceMap.getFont("jtf_idarticulocat.font")); // NOI18N
                                jtf_idarticulocat.setText(resourceMap.getString("jtf_idarticulocat.text")); // NOI18N
                                jtf_idarticulocat.setName("jtf_idarticulocat"); // NOI18N

                                jcbx_costo.setText(resourceMap.getString("jcbx_costo.text")); // NOI18N
                                jcbx_costo.setName("jcbx_costo"); // NOI18N
                                jcbx_costo.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jcbx_costoActionPerformed(evt);
                                    }
                                });

                                jcbx_costo1.setText(resourceMap.getString("jcbx_costo1.text")); // NOI18N
                                jcbx_costo1.setName("jcbx_costo1"); // NOI18N
                                jcbx_costo1.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jcbx_costo1ActionPerformed(evt);
                                    }
                                });

                                javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
                                jPanel3.setLayout(jPanel3Layout);
                                jPanel3Layout.setHorizontalGroup(
                                    jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jLabel4)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jlbl_textobuscado, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel3)
                                        .addGap(18, 18, 18)
                                        .addComponent(jlbl_cantidadregistros, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jLabel5)
                                        .addGap(197, 197, 197)
                                        .addComponent(jtf_idarticulocat, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(93, 93, 93)
                                        .addComponent(jcbx_costo)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 60, Short.MAX_VALUE)
                                        .addComponent(jcbx_costo1, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(21, 21, 21))
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1070, Short.MAX_VALUE)
                                );
                                jPanel3Layout.setVerticalGroup(
                                    jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel5)
                                            .addComponent(jlbl_cantidadregistros)
                                            .addComponent(jLabel3)
                                            .addComponent(jLabel4)
                                            .addComponent(jlbl_textobuscado)
                                            .addComponent(jtf_idarticulocat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jcbx_costo)
                                            .addComponent(jcbx_costo1))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 442, Short.MAX_VALUE))
                                );

                                jTabbedPane1.addTab(resourceMap.getString("jPanel3.TabConstraints.tabTitle"), jPanel3); // NOI18N

                                jPanel4.setName("jPanel4"); // NOI18N

                                jchbx_verexistencias.setText(resourceMap.getString("jchbx_verexistencias.text")); // NOI18N
                                jchbx_verexistencias.setName("jchbx_verexistencias"); // NOI18N
                                jchbx_verexistencias.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jchbx_verexistenciasActionPerformed(evt);
                                    }
                                });

                                jPanel8.setName("jPanel8"); // NOI18N

                                jScrollPane11.setName("jScrollPane11"); // NOI18N

                                jep_articuloimagen.setContentType(resourceMap.getString("jep_articuloimagen.contentType")); // NOI18N
                                jep_articuloimagen.setName("jep_articuloimagen"); // NOI18N
                                jScrollPane11.setViewportView(jep_articuloimagen);

                                javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
                                jPanel8.setLayout(jPanel8Layout);
                                jPanel8Layout.setHorizontalGroup(
                                    jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel8Layout.createSequentialGroup()
                                        .addComponent(jScrollPane11, javax.swing.GroupLayout.DEFAULT_SIZE, 251, Short.MAX_VALUE)
                                        .addContainerGap())
                                );
                                jPanel8Layout.setVerticalGroup(
                                    jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane11, javax.swing.GroupLayout.DEFAULT_SIZE, 148, Short.MAX_VALUE)
                                );

                                jPanel6.setName("jPanel6"); // NOI18N

                                jScrollPane2.setName("jScrollPane2"); // NOI18N

                                jtb_catalogo_artiexis.setModel(this.jtable_modelo_existencias);
                                jtb_catalogo_artiexis.setName("jtb_catalogo_artiexis"); // NOI18N
                                jtb_catalogo_artiexis.setRowHeight(26);
                                jtb_catalogo_artiexis.addMouseListener(new java.awt.event.MouseAdapter() {
                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                        jtb_catalogo_artiexisMouseClicked(evt);
                                        if(evt.getClickCount() >= 1)
                                        {
                                            dioclickidartideta(evt);
                                            //System.out.println(" double click" );

                                        }
                                        if(evt.getClickCount() >= 2)
                                        {
                                            dioclickexi(evt);
                                            //System.out.println(" double click" );

                                        }
                                    }
                                });
                                jtb_catalogo_artiexis.addKeyListener(new java.awt.event.KeyAdapter() {
                                    public void keyPressed(java.awt.event.KeyEvent evt) {
                                        jtb_catalogo_artiexisKeyPressed(evt);
                                    }
                                });
                                jScrollPane2.setViewportView(jtb_catalogo_artiexis);

                                javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
                                jPanel6.setLayout(jPanel6Layout);
                                jPanel6Layout.setHorizontalGroup(
                                    jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 1076, Short.MAX_VALUE)
                                );
                                jPanel6Layout.setVerticalGroup(
                                    jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 331, Short.MAX_VALUE)
                                );

                                jtf_idarticulo_exi.setFont(resourceMap.getFont("jtf_idarticulo_exi.font")); // NOI18N
                                jtf_idarticulo_exi.setText(resourceMap.getString("jtf_idarticulo_exi.text")); // NOI18N
                                jtf_idarticulo_exi.setName("jtf_idarticulo_exi"); // NOI18N

                                jbtn_imagenfull.setFont(resourceMap.getFont("jbtn_imagenfull.font")); // NOI18N
                                jbtn_imagenfull.setIcon(resourceMap.getIcon("jbtn_imagenfull.icon")); // NOI18N
                                jbtn_imagenfull.setText(resourceMap.getString("jbtn_imagenfull.text")); // NOI18N
                                jbtn_imagenfull.setToolTipText(resourceMap.getString("jbtn_imagenfull.toolTipText")); // NOI18N
                                jbtn_imagenfull.setName("jbtn_imagenfull"); // NOI18N
                                jbtn_imagenfull.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_imagenfullActionPerformed(evt);
                                    }
                                });

                                buttonGroup4.add(jrbtn_evgen);
                                jrbtn_evgen.setText(resourceMap.getString("jrbtn_evgen.text")); // NOI18N
                                jrbtn_evgen.setActionCommand(resourceMap.getString("jrbtn_evgen.actionCommand")); // NOI18N
                                jrbtn_evgen.setName("jrbtn_evgen"); // NOI18N
                                jrbtn_evgen.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrbtn_evgenActionPerformed(evt);
                                    }
                                });

                                buttonGroup4.add(jrbtn_existencia);
                                jrbtn_existencia.setText(resourceMap.getString("jrbtn_existencia.text")); // NOI18N
                                jrbtn_existencia.setActionCommand(resourceMap.getString("jrbtn_existencia.actionCommand")); // NOI18N
                                jrbtn_existencia.setName("jrbtn_existencia"); // NOI18N
                                jrbtn_existencia.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrbtn_existenciaActionPerformed(evt);
                                    }
                                });

                                jtf_idarticulo_exi2.setEditable(false);
                                jtf_idarticulo_exi2.setFont(resourceMap.getFont("jtf_idarticulo_exi2.font")); // NOI18N
                                jtf_idarticulo_exi2.setName("jtf_idarticulo_exi2"); // NOI18N

                                javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
                                jPanel4.setLayout(jPanel4Layout);
                                jPanel4Layout.setHorizontalGroup(
                                    jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addContainerGap()
                                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addGroup(jPanel4Layout.createSequentialGroup()
                                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                                        .addComponent(jchbx_verexistencias)
                                                        .addGap(57, 57, 57)
                                                        .addComponent(jrbtn_evgen)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(jrbtn_existencia)
                                                        .addGap(68, 68, 68))
                                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                            .addComponent(jtf_idarticulo_exi2, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(jtf_idarticulo_exi, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                                                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(29, 29, 29)
                                                .addComponent(jbtn_imagenfull)
                                                .addContainerGap(351, Short.MAX_VALUE))))
                                );
                                jPanel4Layout.setVerticalGroup(
                                    jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel4Layout.createSequentialGroup()
                                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jchbx_verexistencias)
                                            .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(jPanel4Layout.createSequentialGroup()
                                                .addContainerGap()
                                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jrbtn_evgen)
                                                    .addComponent(jrbtn_existencia))
                                                .addGap(18, 18, 18)
                                                .addComponent(jtf_idarticulo_exi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jtf_idarticulo_exi2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(jPanel4Layout.createSequentialGroup()
                                                .addContainerGap()
                                                .addComponent(jbtn_imagenfull)))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                );

                                jTabbedPane1.addTab(resourceMap.getString("jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N

                                jPanel5.setName("jPanel5"); // NOI18N

                                jScrollPane3.setName("jScrollPane3"); // NOI18N

                                jepn_fotos.setContentType(resourceMap.getString("jepn_fotos.contentType")); // NOI18N
                                jepn_fotos.setName("jepn_fotos"); // NOI18N
                                jScrollPane3.setViewportView(jepn_fotos);

                                jcbx_catalgoimagenes.setText(resourceMap.getString("jcbx_catalgoimagenes.text")); // NOI18N
                                jcbx_catalgoimagenes.setName("jcbx_catalgoimagenes"); // NOI18N
                                jcbx_catalgoimagenes.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jcbx_catalgoimagenesActionPerformed(evt);
                                    }
                                });

                                jlbl_paginas.setText(resourceMap.getString("jlbl_paginas.text")); // NOI18N
                                jlbl_paginas.setName("jlbl_paginas"); // NOI18N

                                jbtn_anterior.setIcon(resourceMap.getIcon("jbtn_anterior.icon")); // NOI18N
                                jbtn_anterior.setText(resourceMap.getString("jbtn_anterior.text")); // NOI18N
                                jbtn_anterior.setName("jbtn_anterior"); // NOI18N
                                jbtn_anterior.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_anteriorActionPerformed(evt);
                                    }
                                });

                                jbtn_siguiente.setIcon(resourceMap.getIcon("jbtn_siguiente.icon")); // NOI18N
                                jbtn_siguiente.setText(resourceMap.getString("jbtn_siguiente.text")); // NOI18N
                                jbtn_siguiente.setName("jbtn_siguiente"); // NOI18N
                                jbtn_siguiente.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_siguienteActionPerformed(evt);
                                    }
                                });

                                jtf_paginaactual.setText(resourceMap.getString("jtf_paginaactual.text")); // NOI18N
                                jtf_paginaactual.setName("jtf_paginaactual"); // NOI18N
                                jtf_paginaactual.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jtf_paginaactualActionPerformed(evt);
                                    }
                                });

                                jtf_fotosartxpag.setText(resourceMap.getString("jtf_fotosartxpag.text")); // NOI18N
                                jtf_fotosartxpag.setToolTipText(resourceMap.getString("jtf_fotosartxpag.toolTipText")); // NOI18N
                                jtf_fotosartxpag.setName("jtf_fotosartxpag"); // NOI18N
                                jtf_fotosartxpag.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jtf_fotosartxpagActionPerformed(evt);
                                    }
                                });

                                javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
                                jPanel5.setLayout(jPanel5Layout);
                                jPanel5Layout.setHorizontalGroup(
                                    jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel5Layout.createSequentialGroup()
                                        .addContainerGap()
                                        .addComponent(jcbx_catalgoimagenes)
                                        .addGap(18, 18, 18)
                                        .addComponent(jtf_fotosartxpag, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(50, 50, 50)
                                        .addComponent(jlbl_paginas)
                                        .addGap(27, 27, 27)
                                        .addComponent(jbtn_anterior)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jtf_paginaactual, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jbtn_siguiente)
                                        .addContainerGap(484, Short.MAX_VALUE))
                                    .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 1086, Short.MAX_VALUE)
                                );
                                jPanel5Layout.setVerticalGroup(
                                    jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel5Layout.createSequentialGroup()
                                        .addContainerGap()
                                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jlbl_paginas)
                                            .addComponent(jbtn_anterior)
                                            .addComponent(jbtn_siguiente)
                                            .addComponent(jtf_paginaactual, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jcbx_catalgoimagenes)
                                            .addComponent(jtf_fotosartxpag, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jScrollPane3, javax.swing.GroupLayout.DEFAULT_SIZE, 443, Short.MAX_VALUE))
                                );

                                jTabbedPane1.addTab(resourceMap.getString("jPanel5.TabConstraints.tabTitle"), jPanel5); // NOI18N

                                jPanel7.setName("jPanel7"); // NOI18N

                                jScrollPane5.setName("jScrollPane5"); // NOI18N

                                jtb_catalogo_articulos1.setModel(this.jtable_modelo_etiq);
                                jtb_catalogo_articulos1.setName("jtb_catalogo_articulos1"); // NOI18N
                                jtb_catalogo_articulos1.setRowHeight(26);
                                jScrollPane5.setViewportView(jtb_catalogo_articulos1);

                                jcbx_historialeti.setSelected(true);
                                jcbx_historialeti.setText(resourceMap.getString("jcbx_historialeti.text")); // NOI18N
                                jcbx_historialeti.setName("jcbx_historialeti"); // NOI18N

                                jbtn_generaeti.setIcon(resourceMap.getIcon("jbtn_generaeti.icon")); // NOI18N
                                jbtn_generaeti.setText(resourceMap.getString("jbtn_generaeti.text")); // NOI18N
                                jbtn_generaeti.setName("jbtn_generaeti"); // NOI18N
                                jbtn_generaeti.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_generaetiActionPerformed(evt);
                                    }
                                });

                                jtf_unidad.setEditable(false);
                                jtf_unidad.setText(resourceMap.getString("jtf_unidad.text")); // NOI18N
                                jtf_unidad.setToolTipText(resourceMap.getString("jtf_unidad.toolTipText")); // NOI18N
                                jtf_unidad.setName("jtf_unidad"); // NOI18N

                                jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
                                jLabel1.setName("jLabel1"); // NOI18N

                                jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
                                jLabel19.setName("jLabel19"); // NOI18N

                                jtf_cantidadeti.setText(resourceMap.getString("jtf_cantidadeti.text")); // NOI18N
                                jtf_cantidadeti.setName("jtf_cantidadeti"); // NOI18N
                                jtf_cantidadeti.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jtf_cantidadetiActionPerformed(evt);
                                    }
                                });

                                javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
                                jPanel7.setLayout(jPanel7Layout);
                                jPanel7Layout.setHorizontalGroup(
                                    jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel7Layout.createSequentialGroup()
                                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel7Layout.createSequentialGroup()
                                                .addContainerGap()
                                                .addComponent(jcbx_historialeti)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jLabel1)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jtf_unidad, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(32, 32, 32)
                                                .addComponent(jLabel19)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jtf_cantidadeti, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(jPanel7Layout.createSequentialGroup()
                                                .addGap(378, 378, 378)
                                                .addComponent(jbtn_generaeti)))
                                        .addContainerGap(513, Short.MAX_VALUE))
                                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel7Layout.createSequentialGroup()
                                            .addGap(8, 8, 8)
                                            .addComponent(jScrollPane5, javax.swing.GroupLayout.DEFAULT_SIZE, 1070, Short.MAX_VALUE)
                                            .addGap(8, 8, 8)))
                                );
                                jPanel7Layout.setVerticalGroup(
                                    jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel7Layout.createSequentialGroup()
                                        .addContainerGap()
                                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jcbx_historialeti)
                                            .addComponent(jLabel1)
                                            .addComponent(jtf_unidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jtf_cantidadeti, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel19))
                                        .addGap(374, 374, 374)
                                        .addComponent(jbtn_generaeti)
                                        .addContainerGap(53, Short.MAX_VALUE))
                                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel7Layout.createSequentialGroup()
                                            .addGap(40, 40, 40)
                                            .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 343, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addContainerGap(102, Short.MAX_VALUE)))
                                );

                                jTabbedPane1.addTab(resourceMap.getString("jPanel7.TabConstraints.tabTitle"), jPanel7); // NOI18N

                                jPanel9.setName("jPanel9"); // NOI18N

                                jScrollPane6.setName("jScrollPane6"); // NOI18N

                                jtb_catalogo_articulos2.setModel(this.jtable_modelo2);
                                jtb_catalogo_articulos2.setName("jtb_catalogo_articulos2"); // NOI18N
                                jtb_catalogo_articulos2.setRowHeight(26);
                                jtb_catalogo_articulos2.addMouseListener(new java.awt.event.MouseAdapter() {
                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                        jtb_catalogo_articulos2MouseClicked(evt);
                                        if(evt.getClickCount() >= 1)
                                        {
                                            dioclickpromo(evt);
                                            //System.out.println(" double click" );

                                        }
                                    }
                                });
                                jScrollPane6.setViewportView(jtb_catalogo_articulos2);

                                jScrollPane7.setName("jScrollPane7"); // NOI18N

                                jtb_catalogo_articulos3.setModel(this.jtable_modelop);
                                jtb_catalogo_articulos3.setName("jtb_catalogo_articulos3"); // NOI18N
                                jtb_catalogo_articulos3.setRowHeight(26);
                                jScrollPane7.setViewportView(jtb_catalogo_articulos3);

                                jPanel10.setName("jPanel10"); // NOI18N

                                jtf_idproductopromo.setEditable(false);
                                jtf_idproductopromo.setFont(resourceMap.getFont("jtf_idproductopromo.font")); // NOI18N
                                jtf_idproductopromo.setText(resourceMap.getString("jtf_idproductopromo.text")); // NOI18N
                                jtf_idproductopromo.setName("jtf_idproductopromo"); // NOI18N

                                jbtn_promocionsugerencia.setIcon(resourceMap.getIcon("jbtn_promocionsugerencia.icon")); // NOI18N
                                jbtn_promocionsugerencia.setText(resourceMap.getString("jbtn_promocionsugerencia.text")); // NOI18N
                                jbtn_promocionsugerencia.setToolTipText(resourceMap.getString("jbtn_promocionsugerencia.toolTipText")); // NOI18N
                                jbtn_promocionsugerencia.setName("jbtn_promocionsugerencia"); // NOI18N
                                jbtn_promocionsugerencia.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_promocionsugerenciaActionPerformed(evt);
                                    }
                                });

                                jScrollPane8.setName("jScrollPane8"); // NOI18N

                                jt_catempleados1.setModel(this.jtable_modelo_prosug);
                                jt_catempleados1.setName("jt_catempleados1"); // NOI18N
                                jt_catempleados1.setRowHeight(26);
                                jScrollPane8.setViewportView(jt_catempleados1);

                                jtf_idartsug.setEditable(false);
                                jtf_idartsug.setText(resourceMap.getString("jtf_idartsug.text")); // NOI18N
                                jtf_idartsug.setName("jtf_idartsug"); // NOI18N
                                jtf_idartsug.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jtf_idartsugActionPerformed(evt);
                                    }
                                });

                                javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
                                jPanel10.setLayout(jPanel10Layout);
                                jPanel10Layout.setHorizontalGroup(
                                    jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                                        .addContainerGap()
                                        .addComponent(jtf_idproductopromo, javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jtf_idartsug, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addComponent(jbtn_promocionsugerencia)
                                        .addContainerGap())
                                    .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 476, Short.MAX_VALUE)
                                );
                                jPanel10Layout.setVerticalGroup(
                                    jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel10Layout.createSequentialGroup()
                                        .addContainerGap()
                                        .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jtf_idproductopromo, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jbtn_promocionsugerencia)
                                            .addComponent(jtf_idartsug, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGap(18, 18, 18)
                                        .addComponent(jScrollPane8, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE))
                                );

                                jLabel6.setFont(resourceMap.getFont("jLabel6.font")); // NOI18N
                                jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
                                jLabel6.setName("jLabel6"); // NOI18N

                                jLabel7.setFont(resourceMap.getFont("jLabel7.font")); // NOI18N
                                jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
                                jLabel7.setName("jLabel7"); // NOI18N

                                jlbl_cantidadregistros1.setFont(resourceMap.getFont("jlbl_cantidadregistros1.font")); // NOI18N
                                jlbl_cantidadregistros1.setText(resourceMap.getString("jlbl_cantidadregistros1.text")); // NOI18N
                                jlbl_cantidadregistros1.setName("jlbl_cantidadregistros1"); // NOI18N

                                jLabel8.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
                                jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
                                jLabel8.setName("jLabel8"); // NOI18N

                                javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
                                jPanel9.setLayout(jPanel9Layout);
                                jPanel9Layout.setHorizontalGroup(
                                    jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 1086, Short.MAX_VALUE)
                                    .addGroup(jPanel9Layout.createSequentialGroup()
                                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 604, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGroup(jPanel9Layout.createSequentialGroup()
                                                .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 362, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(54, 54, 54)
                                                .addComponent(jLabel7)
                                                .addGap(18, 18, 18)
                                                .addComponent(jlbl_cantidadregistros1, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jLabel8)))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                );
                                jPanel9Layout.setVerticalGroup(
                                    jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel9Layout.createSequentialGroup()
                                        .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 192, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel9Layout.createSequentialGroup()
                                                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel8)
                                                    .addComponent(jlbl_cantidadregistros1)
                                                    .addComponent(jLabel7))
                                                .addGap(17, 17, 17))
                                            .addGroup(jPanel9Layout.createSequentialGroup()
                                                .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                                .addContainerGap())))
                                );

                                jTabbedPane1.addTab(resourceMap.getString("jPanel9.TabConstraints.tabTitle"), jPanel9); // NOI18N

                                jPanel11.setName("jPanel11"); // NOI18N

                                jPanel12.setName("jPanel12"); // NOI18N

                                jScrollPane14.setName("jScrollPane14"); // NOI18N

                                jtbl_articulosentiendas1.setModel(this.jtable_modelo_detallealmab);
                                jtbl_articulosentiendas1.setName("jtbl_articulosentiendas1"); // NOI18N
                                jtbl_articulosentiendas1.setRowHeight(26);
                                jtbl_articulosentiendas1.addMouseListener(new java.awt.event.MouseAdapter() {
                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                        jtbl_articulosentiendas1MouseClicked(evt);
                                        if(evt.getClickCount() >= 1)
                                        {
                                            dioclickidartidetaubi(evt);
                                            //System.out.println(" double click" );

                                        }
                                    }
                                });
                                jScrollPane14.setViewportView(jtbl_articulosentiendas1);

                                jtf_tiendaarti1.setEditable(false);
                                jtf_tiendaarti1.setText(resourceMap.getString("jtf_tiendaarti1.text")); // NOI18N
                                jtf_tiendaarti1.setName("jtf_tiendaarti1"); // NOI18N

                                id_tienda.setEditable(false);
                                id_tienda.setFont(resourceMap.getFont("id_tienda.font")); // NOI18N
                                id_tienda.setText(resourceMap.getString("id_tienda.text")); // NOI18N
                                id_tienda.setName("id_tienda"); // NOI18N

                                id_tienda1.setEditable(false);
                                id_tienda1.setFont(resourceMap.getFont("id_tienda1.font")); // NOI18N
                                id_tienda1.setText(resourceMap.getString("id_tienda1.text")); // NOI18N
                                id_tienda1.setName("id_tienda1"); // NOI18N

                                jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
                                jLabel9.setName("jLabel9"); // NOI18N

                                jcbx_tiendas.setToolTipText(resourceMap.getString("jcbx_tiendas.toolTipText")); // NOI18N
                                jcbx_tiendas.setName("jcbx_tiendas"); // NOI18N
                                jcbx_tiendas.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jcbx_tiendasActionPerformed(evt);
                                    }
                                });

                                jScrollPane17.setName("jScrollPane17"); // NOI18N

                                jlst_clientesdistribucion2.setModel(this.modeloub);
                                jlst_clientesdistribucion2.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
                                jlst_clientesdistribucion2.setName("jlst_clientesdistribucion2"); // NOI18N
                                jlst_clientesdistribucion2.addMouseListener(new java.awt.event.MouseAdapter() {
                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                        jlst_clientesdistribucion2MouseClicked(evt);
                                        if(evt.getClickCount() >= 1)
                                        {
                                            dioclickht(evt);
                                        }
                                    }
                                });
                                jScrollPane17.setViewportView(jlst_clientesdistribucion2);

                                jScrollPane18.setName("jScrollPane18"); // NOI18N

                                jlst_clientesdistribucion3.setModel(this.modelout);
                                jlst_clientesdistribucion3.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
                                jlst_clientesdistribucion3.setName("jlst_clientesdistribucion3"); // NOI18N
                                jlst_clientesdistribucion3.addMouseListener(new java.awt.event.MouseAdapter() {
                                    public void mouseClicked(java.awt.event.MouseEvent evt) {
                                        jlst_clientesdistribucion3MouseClicked(evt);
                                        if(evt.getClickCount() >= 1)
                                        {
                                            dioclickhb(evt);
                                        }
                                    }
                                });
                                jScrollPane18.setViewportView(jlst_clientesdistribucion3);

                                jtf_tiendaarti2.setEditable(false);
                                jtf_tiendaarti2.setText(resourceMap.getString("jtf_tiendaarti2.text")); // NOI18N
                                jtf_tiendaarti2.setName("jtf_tiendaarti2"); // NOI18N

                                buttonGroup5.add(jrbtn_modoactualizacion);
                                jrbtn_modoactualizacion.setText(resourceMap.getString("jrbtn_modoactualizacion.text")); // NOI18N
                                jrbtn_modoactualizacion.setActionCommand(resourceMap.getString("jrbtn_modoactualizacion.actionCommand")); // NOI18N
                                jrbtn_modoactualizacion.setName("jrbtn_modoactualizacion"); // NOI18N
                                jrbtn_modoactualizacion.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrbtn_modoactualizacionActionPerformed(evt);
                                    }
                                });

                                buttonGroup5.add(jbtn_modoactulizacon);
                                jbtn_modoactulizacon.setText(resourceMap.getString("jbtn_modoactulizacon.text")); // NOI18N
                                jbtn_modoactulizacon.setActionCommand(resourceMap.getString("jbtn_modoactulizacon.actionCommand")); // NOI18N
                                jbtn_modoactulizacon.setName("jbtn_modoactulizacon"); // NOI18N
                                jbtn_modoactulizacon.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_modoactulizaconActionPerformed(evt);
                                    }
                                });

                                jtf_preciotienda.setEditable(false);
                                jtf_preciotienda.setText(resourceMap.getString("jtf_preciotienda.text")); // NOI18N
                                jtf_preciotienda.setName("jtf_preciotienda"); // NOI18N

                                jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
                                jLabel11.setName("jLabel11"); // NOI18N

                                jtf_preciobodega.setEditable(false);
                                jtf_preciobodega.setText(resourceMap.getString("jtf_preciobodega.text")); // NOI18N
                                jtf_preciobodega.setName("jtf_preciobodega"); // NOI18N

                                jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
                                jLabel12.setName("jLabel12"); // NOI18N

                                jButton3.setText(resourceMap.getString("jButton3.text")); // NOI18N
                                jButton3.setName("jButton3"); // NOI18N
                                jButton3.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jButton3ActionPerformed(evt);
                                    }
                                });

                                jScrollPane12.setName("jScrollPane12"); // NOI18N

                                jep_articuloimagen1.setContentType(resourceMap.getString("jep_articuloimagen1.contentType")); // NOI18N
                                jep_articuloimagen1.setName("jep_articuloimagen1"); // NOI18N
                                jScrollPane12.setViewportView(jep_articuloimagen1);

                                jcbx_viajes.setToolTipText(resourceMap.getString("jcbx_viajes.toolTipText")); // NOI18N
                                jcbx_viajes.setName("jcbx_viajes"); // NOI18N
                                jcbx_viajes.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jcbx_viajesActionPerformed(evt);
                                    }
                                });

                                jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
                                jLabel13.setName("jLabel13"); // NOI18N

                                buttonGroup5.add(jrbtn_modoactualizacion1);
                                jrbtn_modoactualizacion1.setText(resourceMap.getString("jrbtn_modoactualizacion1.text")); // NOI18N
                                jrbtn_modoactualizacion1.setActionCommand(resourceMap.getString("jrbtn_modoactualizacion1.actionCommand")); // NOI18N
                                jrbtn_modoactualizacion1.setName("jrbtn_modoactualizacion1"); // NOI18N
                                jrbtn_modoactualizacion1.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jrbtn_modoactualizacion1ActionPerformed(evt);
                                    }
                                });

                                jtf_idarticulo_exi1.setEditable(false);
                                jtf_idarticulo_exi1.setFont(resourceMap.getFont("jtf_idarticulo_exi1.font")); // NOI18N
                                jtf_idarticulo_exi1.setName("jtf_idarticulo_exi1"); // NOI18N

                                jbtn_ubicacionquitar.setText(resourceMap.getString("jbtn_ubicacionquitar.text")); // NOI18N
                                jbtn_ubicacionquitar.setToolTipText(resourceMap.getString("jbtn_ubicacionquitar.toolTipText")); // NOI18N
                                jbtn_ubicacionquitar.setName("jbtn_ubicacionquitar"); // NOI18N
                                jbtn_ubicacionquitar.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jbtn_ubicacionquitarActionPerformed(evt);
                                    }
                                });

                                jScrollPane19.setName("jScrollPane19"); // NOI18N

                                jlst_clientesdistribucion4.setModel(this.modeloubhis);
                                jlst_clientesdistribucion4.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
                                jlst_clientesdistribucion4.setName("jlst_clientesdistribucion4"); // NOI18N
                                jScrollPane19.setViewportView(jlst_clientesdistribucion4);

                                javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
                                jPanel12.setLayout(jPanel12Layout);
                                jPanel12Layout.setHorizontalGroup(
                                    jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel12Layout.createSequentialGroup()
                                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel12Layout.createSequentialGroup()
                                                .addContainerGap()
                                                .addComponent(jLabel13)
                                                .addGap(124, 124, 124))
                                            .addComponent(jcbx_viajes, 0, 166, Short.MAX_VALUE)
                                            .addGroup(jPanel12Layout.createSequentialGroup()
                                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                    .addComponent(jtf_tiendaarti1, javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(jLabel9, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(jPanel12Layout.createSequentialGroup()
                                                        .addComponent(id_tienda, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addComponent(id_tienda1, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                    .addComponent(jcbx_tiendas, 0, 119, Short.MAX_VALUE)))
                                            .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 186, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jScrollPane17, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jScrollPane18, javax.swing.GroupLayout.PREFERRED_SIZE, 147, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel12Layout.createSequentialGroup()
                                                .addComponent(jLabel12, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jtf_preciobodega, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addComponent(jtf_preciotienda, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel12Layout.createSequentialGroup()
                                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                                    .addComponent(jScrollPane19, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 282, Short.MAX_VALUE)
                                                    .addGroup(jPanel12Layout.createSequentialGroup()
                                                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                                            .addComponent(jtf_tiendaarti2, javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(jrbtn_modoactualizacion, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(jrbtn_modoactualizacion1)
                                                            .addComponent(jtf_idarticulo_exi1, javax.swing.GroupLayout.DEFAULT_SIZE, 147, Short.MAX_VALUE))))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                                    .addComponent(jbtn_ubicacionquitar, 0, 0, Short.MAX_VALUE)
                                                    .addComponent(jbtn_modoactulizacon, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE))))
                                        .addContainerGap())
                                    .addComponent(jScrollPane14, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1086, Short.MAX_VALUE)
                                );
                                jPanel12Layout.setVerticalGroup(
                                    jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel12Layout.createSequentialGroup()
                                        .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 310, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(18, 18, 18)
                                        .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jPanel12Layout.createSequentialGroup()
                                                .addComponent(jLabel13)
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jcbx_viajes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(9, 9, 9)
                                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jtf_tiendaarti1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(id_tienda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(id_tienda1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jcbx_tiendas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel9))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)
                                                .addComponent(jButton3))
                                            .addComponent(jScrollPane17, javax.swing.GroupLayout.DEFAULT_SIZE, 135, Short.MAX_VALUE)
                                            .addComponent(jScrollPane18, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 135, Short.MAX_VALUE)
                                            .addGroup(jPanel12Layout.createSequentialGroup()
                                                .addGap(1, 1, 1)
                                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jtf_preciotienda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel11)
                                                    .addComponent(jtf_preciobodega, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jLabel12))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jrbtn_modoactualizacion)
                                                    .addComponent(jbtn_modoactulizacon)
                                                    .addComponent(jrbtn_modoactualizacion1))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                .addGroup(jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(jtf_tiendaarti2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(jbtn_ubicacionquitar)
                                                    .addComponent(jtf_idarticulo_exi1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                .addComponent(jScrollPane19, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addComponent(jScrollPane12, javax.swing.GroupLayout.DEFAULT_SIZE, 135, Short.MAX_VALUE))
                                        .addContainerGap())
                                );

                                javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
                                jPanel11.setLayout(jPanel11Layout);
                                jPanel11Layout.setHorizontalGroup(
                                    jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                );
                                jPanel11Layout.setVerticalGroup(
                                    jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel11Layout.createSequentialGroup()
                                        .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addContainerGap())
                                );

                                jTabbedPane1.addTab(resourceMap.getString("jPanel11.TabConstraints.tabTitle"), jPanel11); // NOI18N

                                jMenuBar1.setName("jMenuBar1"); // NOI18N

                                jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
                                jMenu1.setName("jMenu1"); // NOI18N

                                jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.ALT_MASK));
                                jMenuItem2.setIcon(resourceMap.getIcon("jMenuItem2.icon")); // NOI18N
                                jMenuItem2.setText(resourceMap.getString("jMenuItem2.text")); // NOI18N
                                jMenuItem2.setName("jMenuItem2"); // NOI18N
                                jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jMenuItem2ActionPerformed(evt);
                                    }
                                });
                                jMenu1.add(jMenuItem2);

                                jMenuItem4.setText(resourceMap.getString("jMenuItem4.text")); // NOI18N
                                jMenuItem4.setName("jMenuItem4"); // NOI18N
                                jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jMenuItem4ActionPerformed(evt);
                                    }
                                });
                                jMenu1.add(jMenuItem4);

                                jMenuItem7.setText(resourceMap.getString("jMenuItem7.text")); // NOI18N
                                jMenuItem7.setName("jMenuItem7"); // NOI18N
                                jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jMenuItem7ActionPerformed(evt);
                                    }
                                });
                                jMenu1.add(jMenuItem7);

                                jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
                                jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
                                jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
                                jmni_salir.setName("jmni_salir"); // NOI18N
                                jmni_salir.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jmni_salirActionPerformed(evt);
                                    }
                                });
                                jMenu1.add(jmni_salir);

                                jMenuBar1.add(jMenu1);

                                jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
                                jMenu2.setName("jMenu2"); // NOI18N
                                jMenu2.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jMenu2ActionPerformed(evt);
                                    }
                                });

                                jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_B, java.awt.event.InputEvent.CTRL_MASK));
                                jMenuItem1.setIcon(resourceMap.getIcon("jMenuItem1.icon")); // NOI18N
                                jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
                                jMenuItem1.setName("jMenuItem1"); // NOI18N
                                jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jMenuItem1ActionPerformed(evt);
                                    }
                                });
                                jMenu2.add(jMenuItem1);

                                jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.ALT_MASK));
                                jMenuItem3.setText(resourceMap.getString("jMenuItem3.text")); // NOI18N
                                jMenuItem3.setName("jMenuItem3"); // NOI18N
                                jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jMenuItem3ActionPerformed(evt);
                                    }
                                });
                                jMenu2.add(jMenuItem3);

                                jmni_escape.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
                                jmni_escape.setText(resourceMap.getString("jmni_escape.text")); // NOI18N
                                jmni_escape.setName("jmni_escape"); // NOI18N
                                jmni_escape.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jmni_escapeActionPerformed(evt);
                                    }
                                });
                                jMenu2.add(jmni_escape);

                                jmni_tenersuerte.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_E, java.awt.event.InputEvent.CTRL_MASK));
                                jmni_tenersuerte.setText(resourceMap.getString("jmni_tenersuerte.text")); // NOI18N
                                jmni_tenersuerte.setName("jmni_tenersuerte"); // NOI18N
                                jmni_tenersuerte.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jmni_tenersuerteActionPerformed(evt);
                                    }
                                });
                                jMenu2.add(jmni_tenersuerte);

                                jmni_importar.setText(resourceMap.getString("jmni_importar.text")); // NOI18N
                                jmni_importar.setName("jmni_importar"); // NOI18N
                                jmni_importar.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jmni_importarActionPerformed(evt);
                                    }
                                });
                                jMenu2.add(jmni_importar);

                                jMenuItem6.setText(resourceMap.getString("jMenuItem6.text")); // NOI18N
                                jMenuItem6.setName("jMenuItem6"); // NOI18N
                                jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jMenuItem6ActionPerformed(evt);
                                    }
                                });
                                jMenu2.add(jMenuItem6);

                                jMenuItem5.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F7, 0));
                                jMenuItem5.setText(resourceMap.getString("jMenuItem5.text")); // NOI18N
                                jMenuItem5.setName("jMenuItem5"); // NOI18N
                                jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jMenuItem5ActionPerformed(evt);
                                    }
                                });
                                jMenu2.add(jMenuItem5);

                                jMenuItem8.setText(resourceMap.getString("jMenuItem8.text")); // NOI18N
                                jMenuItem8.setName("jMenuItem8"); // NOI18N
                                jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jMenuItem8ActionPerformed(evt);
                                    }
                                });
                                jMenu2.add(jMenuItem8);

                                jmni_revpro.setText(resourceMap.getString("jmni_revpro.text")); // NOI18N
                                jmni_revpro.setName("jmni_revpro"); // NOI18N
                                jmni_revpro.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jmni_revproActionPerformed(evt);
                                    }
                                });
                                jMenu2.add(jmni_revpro);

                                jmni_menu.setText(resourceMap.getString("jmni_menu.text")); // NOI18N
                                jmni_menu.setName("jmni_menu"); // NOI18N
                                jmni_menu.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jmni_menuActionPerformed(evt);
                                    }
                                });
                                jMenu2.add(jmni_menu);

                                jMenuItem10.setText(resourceMap.getString("jMenuItem10.text")); // NOI18N
                                jMenuItem10.setName("jMenuItem10"); // NOI18N
                                jMenuItem10.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jMenuItem10ActionPerformed(evt);
                                    }
                                });
                                jMenu2.add(jMenuItem10);

                                jMenuBar1.add(jMenu2);

                                jMenu4.setText(resourceMap.getString("jMenu4.text")); // NOI18N
                                jMenu4.setName("jMenu4"); // NOI18N

                                jMenuItem9.setText(resourceMap.getString("jMenuItem9.text")); // NOI18N
                                jMenuItem9.setName("jMenuItem9"); // NOI18N
                                jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jMenuItem9ActionPerformed(evt);
                                    }
                                });
                                jMenu4.add(jMenuItem9);

                                jmni_altareclasif.setText(resourceMap.getString("jmni_altareclasif.text")); // NOI18N
                                jmni_altareclasif.setName("jmni_altareclasif"); // NOI18N
                                jmni_altareclasif.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jmni_altareclasifActionPerformed(evt);
                                    }
                                });
                                jMenu4.add(jmni_altareclasif);

                                jmni_altadefectuoso.setText(resourceMap.getString("jmni_altadefectuoso.text")); // NOI18N
                                jmni_altadefectuoso.setName("jmni_altadefectuoso"); // NOI18N
                                jmni_altadefectuoso.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jmni_altadefectuosoActionPerformed(evt);
                                    }
                                });
                                jMenu4.add(jmni_altadefectuoso);

                                jMenuBar1.add(jMenu4);

                                jMenu3.setText(resourceMap.getString("jMenu3.text")); // NOI18N
                                jMenu3.setName("jMenu3"); // NOI18N

                                jmn_help.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK));
                                jmn_help.setIcon(resourceMap.getIcon("jmn_help.icon")); // NOI18N
                                jmn_help.setText(resourceMap.getString("jmn_help.text")); // NOI18N
                                jmn_help.setName("jmn_help"); // NOI18N
                                jmn_help.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jmn_helpActionPerformed(evt);
                                    }
                                });
                                jMenu3.add(jmn_help);

                                jmni_creacomentario.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.ALT_MASK));
                                jmni_creacomentario.setText(resourceMap.getString("jmni_creacomentario.text")); // NOI18N
                                jmni_creacomentario.setName("jmni_creacomentario"); // NOI18N
                                jmni_creacomentario.addActionListener(new java.awt.event.ActionListener() {
                                    public void actionPerformed(java.awt.event.ActionEvent evt) {
                                        jmni_creacomentarioActionPerformed(evt);
                                    }
                                });
                                jMenu3.add(jmni_creacomentario);

                                jMenuBar1.add(jMenu3);

                                setJMenuBar(jMenuBar1);

                                javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
                                getContentPane().setLayout(layout);
                                layout.setHorizontalGroup(
                                    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                            .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                        .addContainerGap(35, Short.MAX_VALUE))
                                    .addComponent(jTabbedPane1)
                                );
                                layout.setVerticalGroup(
                                    layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jTabbedPane1))
                                );

                                pack();
                            }// </editor-fold>//GEN-END:initComponents

    private void jtb_catalogo_articulosKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtb_catalogo_articulosKeyPressed
        // TODO add your handling code here:
          //control enter se utiliza por un rollo de que al dar enter se mostraban dos veces  el documento
         System.out.println(evt.getKeyCode());
        if (evt.getKeyCode() == 10)
            {
             if (control_enter > 1)
               {
                 try
                    {
                //si entra al if inicializo la variable para evitar qu al regreso entre una vez mas
                        control_enter=0;
                        System.out.println(control_enter);
                        int fila = jtb_catalogo_articulos.getSelectedRow();
                        Object valor = jtb_catalogo_articulos.getValueAt(fila, 3);
                        //JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
                        articulos_sie_editar fase=new articulos_sie_editar(valor.toString());
                        fase.setVisible(true);
                    }
                 catch (Exception ex)
                    {
                        System.out.println("ERROR no ha elegido en el cuadro de texto");
                    }
               }
            }
          control_enter+=1;
    }//GEN-LAST:event_jtb_catalogo_articulosKeyPressed

    private void jtb_catalogo_articulosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jtb_catalogo_articulosMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jtb_catalogo_articulosMouseClicked

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
       if(JOptionPane.showConfirmDialog(null, "Desea Salir?")==0) {
             this.dispose();
        }
}//GEN-LAST:event_jmni_salirActionPerformed

    private void jbtn_buscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_buscarActionPerformed
        // TODO add your handling code here:
       // this.jtf_busqueda.getText();
         if(JOptionPane.showConfirmDialog(null, "Estan Correctos sus Datos?")==0)
            {
            this.executabusqueda(buscamp,opbuscamp,this.jtf_busqueda.getText().toString().toUpperCase().trim());
            carguee=0;
                this.jtf_paginaactual.setText("0");
                if (indexactual == 1)
                    {
                       carguee=1;
                       if (controltiendas==0)
                            {
                                this.iniciar_modelo_tiendasexis();
                            }
                            this.verexistencias();
                    }
                if (indexactual == 2)
                    {
                        //yacarguefotos = 1;
                        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
                    }
                if (indexactual==5)
                    {

                        String arreglo_tiendas[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                        String selectin="",clave[]=null;
                        for(int ii=0;ii<this.jtable_modelo.getRowCount();ii++)
                            {
                                if (ii>0)
                                    {
                                        selectin+=".";
                                    }
                        clave=jtable_modelo.getValueAt(ii ,3).toString().split(":");
                        selectin+=clave[1];
                            }
                        this.carga_datos_detallealmacenbod(17,arreglo_tiendas[0],selectin,1);
                        this.verexistencias_bod(arreglo_tiendas[2],8);
                    }

            }
         else
         {
             this.jtf_busqueda.requestFocus();
         }

        
      
    }//GEN-LAST:event_jbtn_buscarActionPerformed

    private void jrb_bclaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bclaveActionPerformed
        // TODO add your handling code here:

        buscamp=Integer.parseInt(evt.getActionCommand().toString());
        
}//GEN-LAST:event_jrb_bclaveActionPerformed

    private void jrb_bdescripActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bdescripActionPerformed
        // TODO add your handling code here:
        buscamp=Integer.parseInt(evt.getActionCommand().toString());
        
}//GEN-LAST:event_jrb_bdescripActionPerformed

    private void jrb_bitemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bitemActionPerformed
        // TODO add your handling code here:
         buscamp=Integer.parseInt(evt.getActionCommand().toString());
        
    }//GEN-LAST:event_jrb_bitemActionPerformed

    private void jrb_bprecioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bprecioActionPerformed
        // TODO add your handling code here:
         buscamp=Integer.parseInt(evt.getActionCommand().toString());
        
    }//GEN-LAST:event_jrb_bprecioActionPerformed

    private void jrb_obexactoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_obexactoActionPerformed
        // TODO add your handling code here:
         opbuscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrb_obexactoActionPerformed

    private void jrb_obcomienzaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_obcomienzaActionPerformed
        // TODO add your handling code here:
         opbuscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrb_obcomienzaActionPerformed

    private void jrb_obaniwayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_obaniwayActionPerformed
        // TODO add your handling code here:
         opbuscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrb_obaniwayActionPerformed

    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        // TODO add your handling code here:
        this.jbtn_buscarActionPerformed(evt);
    }//GEN-LAST:event_jMenuItem1ActionPerformed

    private void jbtn_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_salirActionPerformed
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jbtn_salirActionPerformed

    private void jtf_busquedaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_busquedaActionPerformed
        // TODO add your handling code here:
        this.jbtn_buscarActionPerformed(evt);
    }//GEN-LAST:event_jtf_busquedaActionPerformed

    private void jmn_helpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmn_helpActionPerformed
        // TODO add your handling code here:
        this.ayuda();
}//GEN-LAST:event_jmn_helpActionPerformed

    private void jrb_bidfamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bidfamActionPerformed
        // TODO add your handling code here:
         buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrb_bidfamActionPerformed

    private void jrb_bidsubfamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bidsubfamActionPerformed
        // TODO add your handling code here:
         buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrb_bidsubfamActionPerformed

    private void jrb_bdessubfamActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bdessubfamActionPerformed
        // TODO add your handling code here:
         buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrb_bdessubfamActionPerformed

    private void jbtn_add_artActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_add_artActionPerformed
        // TODO add your handling code here:
        if(variables_global.getnivelusu()<3)
            {
                JFrame mainFrame = Sie_invdisApp.getApplication().getMainFrame();
                articulos_sie_add faa=new articulos_sie_add(mainFrame,true);
                faa.setVisible(true);
            }
         else
            {
               JOptionPane.showMessageDialog(null,"Opcion no disponible en su Perfil:", "Sistema Integral(Grafica cortes del dia) : Ayuda",1);
            }
    }//GEN-LAST:event_jbtn_add_artActionPerformed

    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        // TODO add your handling code here:
        this.jbtn_add_artActionPerformed(evt);
    }//GEN-LAST:event_jMenuItem2ActionPerformed

    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        // TODO add your handling code here:
        this.jtf_busqueda.setText("");
        this.jtf_busqueda.requestFocus();
    }//GEN-LAST:event_jMenuItem3ActionPerformed

    private void formFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_formFocusGained
        // TODO add your handling code here:
        this.jtf_busqueda.requestFocus();
    }//GEN-LAST:event_formFocusGained

    private void jmni_creacomentarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_creacomentarioActionPerformed
        // TODO add your handling code here:
        this.crearcomentario();
    }//GEN-LAST:event_jmni_creacomentarioActionPerformed

    private void jtb_inveprogramadosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtb_inveprogramadosActionPerformed
        // TODO add your handling code here:
         if(variables_global.getnivelusu()<3)
            {
                 articulos_sie_inveprogramados  asip = new articulos_sie_inveprogramados();
                    asip.pack();
                    asip.setVisible(true);
             }
                     else
            {
               JOptionPane.showMessageDialog(null,"Opcion no disponible en su Perfil:", "Sistema Integral(Grafica cortes del dia) : Ayuda",1);
            }
                
    }//GEN-LAST:event_jtb_inveprogramadosActionPerformed

    private void jbtn_traspasosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_traspasosActionPerformed
        // TODO add your handling code here:
        articulos_sie_traspaso_catalogo astc=new articulos_sie_traspaso_catalogo();
        astc.pack();
        astc.setVisible(true);        // TODO add your handling code here:
    }//GEN-LAST:event_jbtn_traspasosActionPerformed

    private void jbtn_generorequisicionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_generorequisicionActionPerformed
        // TODO add your handling code here:

        articulos_sie_traspaso_requisicion_catalogo astr=new articulos_sie_traspaso_requisicion_catalogo();
        astr.pack();
        astr.setVisible(true);        // TODO add your handling code here:
}//GEN-LAST:event_jbtn_generorequisicionActionPerformed

    private void jmni_escapeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_escapeActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jmni_escapeActionPerformed

    private void jbtn_movimientosalmacenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_movimientosalmacenActionPerformed
        // TODO add your handling code here:
        articulos_sie_almacen_movi_extras asame=new articulos_sie_almacen_movi_extras();
        asame.pack();
        asame.setVisible(true);
    }//GEN-LAST:event_jbtn_movimientosalmacenActionPerformed

    private void jbtn_tendresuerteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_tendresuerteActionPerformed
        // TODO add your handling code here:
        this.jbtn_buscarActionPerformed(evt);
        this.tendresuerte();

}//GEN-LAST:event_jbtn_tendresuerteActionPerformed

    private void jmni_tenersuerteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_tenersuerteActionPerformed
      this.jbtn_tendresuerteActionPerformed(evt);
}//GEN-LAST:event_jmni_tenersuerteActionPerformed

    private void jMenu2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu2ActionPerformed
        // TODO add your handling code here:
        this.jbtn_tendresuerteActionPerformed(evt);
    }//GEN-LAST:event_jMenu2ActionPerformed

    private void jbtn_articulospromocionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_articulospromocionActionPerformed
        // TODO add your handling code here:
        if(variables_global.getnivelusu()<3)
            {
                articulos_sie_promociones_catalogo faspc=new articulos_sie_promociones_catalogo();
                faspc.pack();
                faspc.setVisible(true);
            }
         else
            {
               JOptionPane.showMessageDialog(null,"Opcion no disponible en su Perfil:", "Sistema Integral(Grafica cortes del dia) : Ayuda",1);
            }
    }//GEN-LAST:event_jbtn_articulospromocionActionPerformed

    private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed
        // TODO add your handling code here:
         if(JOptionPane.showConfirmDialog(null, "Desea Generar Archivo esto Puede Tardar unos Minutos?")==0) {
            this.exportar_archivo();
         }
    }//GEN-LAST:event_jMenuItem4ActionPerformed
private void jtb_catalogo_artiexisMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
}
    private void jtb_catalogo_artiexisKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jtb_catalogo_artiexisKeyPressed
        // TODO add your handling code here:
}//GEN-LAST:event_jtb_catalogo_artiexisKeyPressed

    private void jTabbedPane1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPane1StateChanged
        // TODO add your handling code here:
        indexactual = this.jTabbedPane1.getSelectedIndex();
        if(idc>0)
        {
         if ((indexactual == 1) && (carguee==0))
                    {
                       carguee=1;
                       if (controltiendas==0)
                            {
                                this.iniciar_modelo_tiendasexis();
                            }
                            this.verexistencias();
                    }
        if (indexactual == 2)
            {
                //yacarguefotos = 1;
               this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
            }
        if (indexactual == 4)
            {
                //yacarguefotos = 1;
               this.carga_datos_promosug(6,"");
            }
        if((indexactual==5) && (carguee5==0))
            {
                this.cargar_datos_viaje(2, 1, "");
                String arreglo_tiendas[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                this.iniciar_modelo_almacenes(arreglo_tiendas[0],arreglo_tiendas[2]);
                carguee5=1;
            }
        }


    }//GEN-LAST:event_jTabbedPane1StateChanged

    private void jcbx_catalgoimagenesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_catalgoimagenesActionPerformed
        // TODO add your handling code here:
        this.catalogo_imagenessencillo();
    }//GEN-LAST:event_jcbx_catalgoimagenesActionPerformed

    private void jbtn_siguienteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_siguienteActionPerformed
        // TODO add your handling code here:
        this.jtf_paginaactual.setText(String.valueOf(Integer.valueOf(this.jtf_paginaactual.getText().toString())+1));
                           System.out.println("Esta es la pagina que mando"+this.jtf_paginaactual.getText());
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));


    }//GEN-LAST:event_jbtn_siguienteActionPerformed

    private void jbtn_anteriorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_anteriorActionPerformed
        // TODO add your handling code here:
          this.jtf_paginaactual.setText(String.valueOf(Integer.valueOf(this.jtf_paginaactual.getText().toString())-1));
                           System.out.println("Esta es la pagina que mando"+this.jtf_paginaactual.getText());
        this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));

    }//GEN-LAST:event_jbtn_anteriorActionPerformed

    private void jtf_paginaactualActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_paginaactualActionPerformed
        // TODO add your handling code here:
         this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
    }//GEN-LAST:event_jtf_paginaactualActionPerformed

    private void jtf_fotosartxpagActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_fotosartxpagActionPerformed
        // TODO add your handling code here:
         this.carga_datos_fotospaginacion(Integer.valueOf(this.jtf_paginaactual.getText().toString()));
    }//GEN-LAST:event_jtf_fotosartxpagActionPerformed

    private void jchbx_verexistenciasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jchbx_verexistenciasActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Desea Actualizar?")==0) {
            if (controltiendas==0)
                {
                    this.iniciar_modelo_tiendasexis();
                }
            this.verexistencias();
        }
}//GEN-LAST:event_jchbx_verexistenciasActionPerformed

    private void jbtn_salir1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_salir1ActionPerformed
        // TODO add your handling code here:
              articulos_sie_editar_foto fasef=new articulos_sie_editar_foto();
        fasef.pack();
        RefineryUtilities.centerFrameOnScreen(fasef);

        fasef.setVisible(true);
    }//GEN-LAST:event_jbtn_salir1ActionPerformed

    private void jbtn_imagenfullActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_imagenfullActionPerformed
        // TODO add your handling code here:
        articulos_sie_editar_foto fasef=new articulos_sie_editar_foto(this.jtf_idarticulo_exi.getText());
        fasef.pack();
        RefineryUtilities.centerFrameOnScreen(fasef);

        fasef.setVisible(true);
}//GEN-LAST:event_jbtn_imagenfullActionPerformed

    private void jmni_importarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_importarActionPerformed
        // TODO add your handling code here:
          if(JOptionPane.showConfirmDialog(null, "Desea Importar Datos?")==0) {
    while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);
                    while(jtable_modelo2.getRowCount()>0)jtable_modelo2.removeRow(0);
                    while(jtable_modelo_existencias.getRowCount()>0)jtable_modelo_existencias.removeRow(0);
                 this.jcbx_historialne.setSelected(true);

            String arreglo_importa[]=this.jta_archivo.getText().split("\n");
            String arreglo_codigo[]=null;
            System.out.println("Estos tiene archivo:"+arreglo_importa.length);
            for (int i=0;i<arreglo_importa.length;i++) {

                arreglo_codigo=arreglo_importa[i].split("\t");
                this.executabusqueda(1,1,arreglo_codigo[0].trim());


            }
            this.jta_archivo.setText("");
        }
    }//GEN-LAST:event_jmni_importarActionPerformed

    private void jbtn_generaetiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_generaetiActionPerformed
        // TODO add your handling code here:
        this.crearetiqueta();
}//GEN-LAST:event_jbtn_generaetiActionPerformed

    private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed
        // TODO add your handling code here:
        this.jbtn_generaetiActionPerformed(evt);
    }//GEN-LAST:event_jMenuItem5ActionPerformed

    private void jtf_cantidadetiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_cantidadetiActionPerformed
        // TODO add your handling code here:
        for(int ii=0;ii<this.jtable_modelo_etiq.getRowCount();ii++)
                {
                    this.jtable_modelo_etiq.setValueAt(this.jtf_cantidadeti.getText().trim(), ii, 5);
                }
    }//GEN-LAST:event_jtf_cantidadetiActionPerformed

    private void jcbx_historialneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_historialneActionPerformed
        // TODO add your handling code here:
        while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);
         while(jtable_modelo2.getRowCount()>0)jtable_modelo2.removeRow(0);
        while(jtable_modelo_existencias.getRowCount()>0)jtable_modelo_existencias.removeRow(0);
    }//GEN-LAST:event_jcbx_historialneActionPerformed

    private void jcbx_costoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_costoActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jcbx_costoActionPerformed

    private void jrb_lineaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_lineaActionPerformed
        // TODO add your handling code here:
        buscamp=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_lineaActionPerformed

    private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed
        // TODO add your handling code here:
                 if(JOptionPane.showConfirmDialog(null, "Desea Importar Datos CSV ?")==0) {
                    while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);
                    while(jtable_modelo2.getRowCount()>0)jtable_modelo2.removeRow(0);
                    while(jtable_modelo_existencias.getRowCount()>0)jtable_modelo_existencias.removeRow(0);
                 this.jcbx_historialne.setSelected(true);

            String arreglo_importa[]=this.jta_archivo.getText().split("\n");
            String arreglo_codigo[]=null;
            System.out.println("Estos tiene archivo:"+arreglo_importa.length);
            for (int i=0;i<arreglo_importa.length;i++) {

                arreglo_codigo=arreglo_importa[i].split(",");
                this.jtf_cantidadeti.setText(arreglo_codigo[1].trim());
                this.executabusqueda(1,1,arreglo_codigo[0].trim());


            }
            this.jta_archivo.setText("");
        }
    }//GEN-LAST:event_jMenuItem6ActionPerformed

    private void jbtn_promocionsugerenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_promocionsugerenciaActionPerformed
        // TODO add your handling code here:
        if(this.jtf_idproductopromo.getText().toString().length()>1)
    {
    if(JOptionPane.showConfirmDialog(null, "<html><b><h2>Articulo:"+this.jtf_idproductopromo.getText()+"?</h2></b></html>")==0)
        {

        String cadenasql="select * from x1sieuno_articulo_promociones_rebajav2(9,'0','0','"+this.jtf_idartsug.getText()+"',0,'"+variables_global.getdepartamento_des()+"');",retorno="";
       //invoco al metodo que trae el recordset de datos
       System.out.println(cadenasql);
        try
         {
            rs = x.sieuno_executediversosv2(cadenasql,variables_global.getconexiongral());
            while (rs.next())
                {
                    retorno=rs.getString(1);
                }
        }
        catch(Exception e)
        {
                System.out.println(e.getMessage());
        }
        if (retorno.equals("1"))
            {
                JOptionPane.showMessageDialog(null,"Precio Actualizado Correctamente!!", "Sistema Integral Promociones",1);
                this.carga_datos_promosug(6,"");
            }
        }
    }
else
{
    JOptionPane.showMessageDialog(null,"Error Elija una Clave!!", "Sistema Integral Promociones",1);
}
}//GEN-LAST:event_jbtn_promocionsugerenciaActionPerformed

    private void jtf_idartsugActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_idartsugActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_jtf_idartsugActionPerformed

    private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed
        // TODO add your handling code here:
          if(JOptionPane.showConfirmDialog(null, "Desea Generar Archivo esto Puede Tardar unos Minutos?")==0) {
                    this.exportar_archivocompleto();
          }

    }//GEN-LAST:event_jMenuItem7ActionPerformed

    private void jrbtn_idarticuloActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_idarticuloActionPerformed
        // TODO add your handling code here:
buscamp=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_idarticuloActionPerformed

    private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed
        // TODO add your handling code here:

if(JOptionPane.showConfirmDialog(null, "Desea Importar Datos por Clave?")==0)
        {
            String arreglo_importa[]=null;
                    while(jtable_modelo.getRowCount()>0)jtable_modelo.removeRow(0);
                    while(jtable_modelo2.getRowCount()>0)jtable_modelo2.removeRow(0);
                    while(jtable_modelo_existencias.getRowCount()>0)jtable_modelo_existencias.removeRow(0);

            arreglo_importa=this.jta_archivo.getText().split("\n");


            String arreglo_codigo[]=null,selectin="";
            System.out.println("Estos tiene archivo:"+arreglo_importa.length);
            for (int i=0;i<arreglo_importa.length;i++)
                {
                arreglo_codigo=arreglo_importa[i].split("\t");
                    if (i>0)
                        {
                            selectin+=".";
                        }
                    selectin+=""+arreglo_codigo[0].trim()+"";
                }
            this.executabusquedayorigen(12,1,selectin);
            this.jta_archivo.setText("");
        }
    }//GEN-LAST:event_jMenuItem8ActionPerformed

    private void jrbtn_evgenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_evgenActionPerformed
        // TODO add your handling code here:
               vde=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_evgenActionPerformed

    private void jrbtn_existenciaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_existenciaActionPerformed
        // TODO add your handling code here:
        vde=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrbtn_existenciaActionPerformed

    private void jmni_revproActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_revproActionPerformed
        // TODO add your handling code here:
    if(JOptionPane.showConfirmDialog(null, "Desea ver las promociones?")==0)
        {
            String jfecha=JOptionPane.showInputDialog("Ingresa Fecha (aaaa-mm-dd):");
            this.executabusquedapromogen(19, 1,jfecha);
        }
    }//GEN-LAST:event_jmni_revproActionPerformed

    private void jcbx_tiendasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_tiendasActionPerformed
        // TODO add your handling code here:
        if (controlcombo > 0 ) {

                String arreglo_tiendas[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                this.iniciar_modelo_almacenes(arreglo_tiendas[0],arreglo_tiendas[2]);
        }
    }//GEN-LAST:event_jcbx_tiendasActionPerformed

    private void jrbtn_modoactualizacionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_modoactualizacionActionPerformed
        // TODO add your handling code here:
        modoope=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_modoactualizacionActionPerformed

    private void jbtn_modoactulizaconActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_modoactulizaconActionPerformed
        // TODO add your handling code here:
     modoope=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jbtn_modoactulizaconActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
        articulos_sie_editar fase=new articulos_sie_editar(2,this.jtf_idarticulo_exi2.getText());
        fase.pack();
        fase.setVisible(true);
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jcbx_viajesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_viajesActionPerformed
        // TODO add your handling code here:
        if(controlcombo2>0)
            {
                    String valor[] = this.jcbx_viajes.getSelectedItem().toString().split(":");
                    if(JOptionPane.showConfirmDialog(null, "Desea ver detalle?")==0)
                        {
                           
                            String arreglo_tiendas[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                            this.carga_datos_detallealmacenbod(16,arreglo_tiendas[0],valor[0],1);
                            this.verexistencias_bod(arreglo_tiendas[2],8);
                        }
            }
}//GEN-LAST:event_jcbx_viajesActionPerformed

    private void jmni_menuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_menuActionPerformed
        // TODO add your handling code here:
         if(JOptionPane.showConfirmDialog(null, "Desea ver Todos los Articulos?")==0)
                {
                    String arreglo_tiendas[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                    this.carga_datos_detallealmacenbod(19,arreglo_tiendas[0],"0",3);
                }
    }//GEN-LAST:event_jmni_menuActionPerformed

    private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed
        // TODO add your handling code here:

        articulos_sie_traspaso_requisicion_catalogo astr=new articulos_sie_traspaso_requisicion_catalogo();
        astr.pack();
        astr.setVisible(true);  
    }//GEN-LAST:event_jMenuItem9ActionPerformed

    private void jmni_altareclasifActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_altareclasifActionPerformed
        // TODO add your handling code here:
        articulos_sie_almacen_movi_reclasifalta fasamra=new articulos_sie_almacen_movi_reclasifalta(1);
        fasamra.pack();
        fasamra.setVisible(true);
}//GEN-LAST:event_jmni_altareclasifActionPerformed

    private void jmni_altadefectuosoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_altadefectuosoActionPerformed
        // TODO add your handling code here:
        articulos_sie_almacen_movi_reclasifalta fasamra=new articulos_sie_almacen_movi_reclasifalta(2);
        fasamra.pack();
        fasamra.setVisible(true);
}//GEN-LAST:event_jmni_altadefectuosoActionPerformed

    private void jcbx_costo1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcbx_costo1ActionPerformed
        // TODO add your handling code here:
        this.distribucionfotos();
    }//GEN-LAST:event_jcbx_costo1ActionPerformed

    private void jrbtn_modoactualizacion1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrbtn_modoactualizacion1ActionPerformed
        // TODO add your handling code here:
        modoope=Integer.parseInt(evt.getActionCommand().toString());
    }//GEN-LAST:event_jrbtn_modoactualizacion1ActionPerformed

    private void jbtn_ubicacionquitarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_ubicacionquitarActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "<html><b><h2>Desea Eliminar las Ubicaciones Secundarias?<br>"+this.jtf_tiendaarti2.getText()+"<br>Clave :"+this.jtf_idarticulo_exi1.getText()+"</h2></b></html>")==0)
                            {
                                String selectin="",ubi[]=null,texto="",tienda[]=null;
                                ubi=this.jtf_tiendaarti2.getText().toString().split(":");
                                tienda=this.jcbx_tiendas.getSelectedItem().toString().split(":");

                                int ii=0,confirma=0,recorrido=0;
                                  System.out.println(selectin);
                                  if(almacen==1)
                                      {
                                          texto="select * from x1sieuno_articulo_inven_ubicacion_update(6,"+tienda[0]+",'"+this.jtf_idarticulo_exi2.getText()+"','"+ubi[0]+"','','')";
                                      }
                                  if(almacen==2)
                                    {
                                          texto="select * from x1sieuno_articulo_inven_ubicacion_update(6,"+tienda[2]+",'"+this.jtf_idarticulo_exi2.getText()+"','"+ubi[0]+"','','')";
                                    }
                                  System.out.println(texto);
                                    try
                                        {
                                            rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                                            while (rs.next())
                                                {
                                                    confirma=rs.getInt(1);
                                                }
                                        }
                                        catch(Exception e)
                                                {
                                                    System.out.println(e.getMessage());
                                                }
                                        if (confirma==1)
                                                {
                                                    JOptionPane.showMessageDialog(null,"Gracias datos Actualizados Correctamente", "Sistema Integral Insumos",1);
                                                        //while(jtable_modelo_alm_updatereplace.getRowCount()>0)jtable_modelo_alm_updatereplace.removeRow(0);

                                                            if(almacen==1)
                                                                {
                                                                    this.jtable_modelo_detallealmab.setValueAt("Sin Ubicacion Sec.", this.jtbl_articulosentiendas1.getSelectedRow(), 11);
                                                                }
                                                            if(almacen==2)
                                                                {
                                                                    this.jtable_modelo_detallealmab.setValueAt("Sin Ubicacion Sec.", this.jtbl_articulosentiendas1.getSelectedRow(), 10);
                                                                }
                                                               this.jtf_busqueda.requestFocus();
                                                }
                                    else
                                                {
                                                    JOptionPane.showMessageDialog(null,"Error Consulte con Su Administrador", "Sistema Integral Insumos",1);
                                                }
                        }
    }//GEN-LAST:event_jbtn_ubicacionquitarActionPerformed

    private void jMenuItem10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem10ActionPerformed
        // TODO add your handling code here:
                 if(JOptionPane.showConfirmDialog(null, "Desea ver Todos los Articulos?")==0)
                {
                    String arreglo_tiendas[]=this.jcbx_tiendas.getSelectedItem().toString().split(":");
                    this.carga_datos_detallealmacenbod(19,arreglo_tiendas[2],"0",4);
                }
    }//GEN-LAST:event_jMenuItem10ActionPerformed
    private void jtbl_articulosentiendas1MouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
   
    private void jlst_clientesdistribucion2MouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
       private void jlst_clientesdistribucion3MouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }

   private void jtb_catalogo_articulos4MouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private void jtb_catalogo_articulos2MouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    private  void ayuda()
            {
                JOptionPane.showMessageDialog(null," 1.-Catalogo de Articulos, cada una de las Opciones se autodescribe brevemente\n 2.- Cada Boton tiene Una letra Resaltada el cual indica su metodo abreviado, uselo si desea mayor rapides ( ejemplo Alt+a obtendra ayuda automaticamente)\n 3.-Para buscar un Articulo Ingrese en el cuadro de texto luego presion Ctrl+B o Precionando el Boton Buscar . \n ", "Sistema Integral(Catalogo de Articulos) : Ayuda",1);
            }
 private void exportar_archivo()
    {
        FileWriter fichero = null;
        PrintWriter pw = null;
        Object jtunidad=JOptionPane.showInputDialog(null,"Ingresa Unidad:","Unidades",JOptionPane.QUESTION_MESSAGE,null,new Object[] { "C", "D", "E","F","G","H" },"C");
        String texto="select * from x1sieuno_articulo_catalogov2(9,0,'') as (id integer, cla character varying(16),cod character varying(16), des character varying(80),it character varying(20),pre numeric)",anterior="";
        try
        {
            fichero = new FileWriter(jtunidad.toString()+":/Existencia.csv");
            pw = new PrintWriter(fichero);
            try
                {
                    rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                    while (rs.next())
                        {
                            if (!anterior.equals(rs.getString("cla")))
                                    {
                                    pw.println(rs.getString("cla")+","+rs.getString("cod")+","+rs.getString("des")+",0,"+rs.getString("pre"));
                                    }
                            anterior=rs.getString("cla").replace(" ", "");
                        }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }
            
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
           try {
           // Nuevamente aprovechamos el finally para
           // asegurarnos que se cierra el fichero.
           if (null != fichero)
              fichero.close();
                JOptionPane.showMessageDialog(null,"Archivo correcto "+jtunidad.toString()+":/Existencia.csv", "Sistema Integral(Catalogo de Articulos)",1);
           } catch (Exception e2) {
              e2.printStackTrace();
           }
        }
    }
 private void exportar_archivocompleto()
    {
        FileWriter fichero = null;
        PrintWriter pw = null;
        Object jtunidad=JOptionPane.showInputDialog(null,"Ingresa Unidad:","Unidades",JOptionPane.QUESTION_MESSAGE,null,new Object[] { "C", "D", "E","F","G","H" },"C");
        String texto="select * from x1sieuno_articulo_catalogov3(18,0,'') as (id integer, cla character varying(16),cod character varying(16), des character varying(80),it character varying(20),uc numeric,fam integer,idsub integer,pre numeric,fecuc date)",anterior="";
        System.out.println(texto);
        try
        {
            fichero = new FileWriter(jtunidad.toString()+":/Catalogo_articulos.csv");
            pw = new PrintWriter(fichero);
            pw.println("Id,Clave,Codigo,Descripcion,item,costo,precio,idfam,idsub,fecha ultcom");
            try
                {
                    rs = x.sieuno_executediversosv2(texto,variables_global.getconexiongral());
                    while (rs.next())
                        {

                                    pw.println(rs.getString("id")+","+rs.getString("cla")+","+rs.getString("cod")+","+rs.getString("des")+","+rs.getString("it")+","+rs.getString("uc")+","+rs.getString("pre")+","+rs.getString("fam")+","+rs.getString("idsub")+","+rs.getString("fecuc"));

                        }
                }
                catch(Exception e)
                    {
                        System.out.println(e.getMessage());
                    }

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
           try {
           // Nuevamente aprovechamos el finally para
           // asegurarnos que se cierra el fichero.
           if (null != fichero)
              fichero.close();
                JOptionPane.showMessageDialog(null,"Archivo correcto "+jtunidad.toString()+":/Catalogo_articulos.csv", "Sistema Integral(Catalogo de Articulos)",1);
           } catch (Exception e2) {
              e2.printStackTrace();
           }
        }
    }
private void crearetiqueta()
    {
        FileWriter fichero = null;
        PrintWriter pw = null;
        //Object jtunidad=JOptionPane.showInputDialog(null,"Ingresa Unidad:","Unidades",JOptionPane.QUESTION_MESSAGE,null,new Object[] { "C", "D", "E","F","G","H" },"C");
        String texto="",anterior="";
        try
        {
            fichero = new FileWriter(this.jtf_unidad.getText()+":/etiqetas8.csv");
            pw = new PrintWriter(fichero);
            pw.println("codigo,barra,descripcion,item,precio,cantidad");
                for(int ii=0;ii<this.jtable_modelo_etiq.getRowCount();ii++)
                {
                        if(this.jtable_modelo_etiq.getValueAt(ii, 1).toString().length()==8)
                            {
                                texto=this.jtable_modelo_etiq.getValueAt(ii, 1).toString().substring(0, 7);
                            }
                        else
                            {

                                texto=this.jtable_modelo_etiq.getValueAt(ii, 1).toString();
                                JOptionPane.showMessageDialog(null,"<html><h2>la clave "+this.jtable_modelo_etiq.getValueAt(ii, 0).toString()+"<br>Codigo Barra:"+texto+" No corresponde al formato EAN8 Por favor Imprima con otro formato</h2></html>", "Sistema Integral(Catalogo de Articulos)",1);
                            }
                        pw.println(this.jtable_modelo_etiq.getValueAt(ii, 0).toString()+","+texto+","+this.jtable_modelo_etiq.getValueAt(ii, 2).toString()+","+this.jtable_modelo_etiq.getValueAt(ii, 3).toString()+","+this.jtable_modelo_etiq.getValueAt(ii, 4).toString()+","+this.jtable_modelo_etiq.getValueAt(ii, 5).toString());

                }

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
           try {
           // Nuevamente aprovechamos el finally para
           // asegurarnos que se cierra el fichero.
           if (null != fichero)
              fichero.close();
                while(jtable_modelo_etiq.getRowCount()>0)jtable_modelo_etiq.removeRow(0);
                JOptionPane.showMessageDialog(null,"Archivo correcto "+this.jtf_unidad.getText()+":/etiqueta8.csv", "Sistema Integral(Catalogo de Articulos)",1);
           } catch (Exception e2) {
              e2.printStackTrace();
           }
        }
    }
 private void crearcomentario()
{
                 String retorno="";

        String comentario=JOptionPane.showInputDialog("Ingresa Tu Sugerencia o Comentario:");
        if (comentario.length()>0)
        {
            rs = x.sieuno_executediversosv2("select * from x1distribucion_bitacorainserta('"+comentario+"', 'Catalogo Articulos');",variables_global.getconexiongral());
            try
            {
               while (rs.next())
                    {
                         retorno=rs.getString(1);
                   }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
            if (retorno.equals("1"))
              {
                JOptionPane.showMessageDialog(null,"Gracias Tu comentario ha sido guardado", "Sistema Integral Comentarios",1);
              }
      }
    }
private void catalogo_imagenessencillo()
 {
     //limpiar la tabla
        int numerofilas=this.jtable_modelo.getRowCount(),ii=0;
        textohtml="";
        String codigo[]=null;
        for( ii=0;ii<numerofilas;ii++)
                {
                    codigo=this.jtable_modelo.getValueAt(ii, 3).toString().split(":");
                    textohtml+="<tr><th>"+codigo[1]+"</th><th>"+this.jtable_modelo.getValueAt(ii, 6)+ "</th><th>"+this.jtable_modelo.getValueAt(ii, 7)+ "</th><th>"+this.jtable_modelo.getValueAt(ii, 9)+ "</th><th>"+this.jtable_modelo.getValueAt(ii, 9)+ "</th><th>"+"<img src=\"http://"+variables_global.getHostfotos()+"/"+variables_global.getcarpetaaplicacion()+"/fotos/"+codigo[1]+".JPG\" width=230 height=190 border=0 alt=\"Foto Articulo\" />"+"</th></tr>";;
                }
         System.out.println("html text"+textohtml);
        this.jepn_fotos.setText("<html><head></head><body><table>"+textohtml+"</table></body></html>");
 }

private String  fechaeuropea(String fecha) {

         //resibe cadena de fecha en formato americano yyyy-MM-dd
        java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateadoresta.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaeuropa.format(fechaestaeuropa);
       return cadenafecha;

    }
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
               // articulos_sie_catalogo dialog = new articulos_sie_catalogo(new javax.swing.JFrame(), true);
                 articulos_sie_catalogo dialog = new articulos_sie_catalogo();
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.ButtonGroup buttonGroup3;
    private javax.swing.ButtonGroup buttonGroup4;
    private javax.swing.ButtonGroup buttonGroup5;
    private org.postgresql.Driver driver1;
    private javax.swing.JTextField id_tienda;
    private javax.swing.JTextField id_tienda1;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenu jMenu4;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem10;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JMenuItem jMenuItem6;
    private javax.swing.JMenuItem jMenuItem7;
    private javax.swing.JMenuItem jMenuItem8;
    private javax.swing.JMenuItem jMenuItem9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane14;
    private javax.swing.JScrollPane jScrollPane17;
    private javax.swing.JScrollPane jScrollPane18;
    private javax.swing.JScrollPane jScrollPane19;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JButton jbtn_add_art;
    private javax.swing.JButton jbtn_anterior;
    private javax.swing.JButton jbtn_articulospromocion;
    private javax.swing.JButton jbtn_buscar;
    private javax.swing.JButton jbtn_generaeti;
    private javax.swing.JButton jbtn_generorequisicion;
    private javax.swing.JButton jbtn_imagenfull;
    private javax.swing.JRadioButton jbtn_modoactulizacon;
    private javax.swing.JButton jbtn_movimientosalmacen;
    private javax.swing.JButton jbtn_promocionsugerencia;
    private javax.swing.JButton jbtn_salir;
    private javax.swing.JButton jbtn_salir1;
    private javax.swing.JButton jbtn_siguiente;
    private javax.swing.JButton jbtn_tendresuerte;
    private javax.swing.JButton jbtn_traspasos;
    private javax.swing.JButton jbtn_ubicacionquitar;
    private javax.swing.JCheckBox jcbx_catalgoimagenes;
    private javax.swing.JCheckBox jcbx_costo;
    private javax.swing.JCheckBox jcbx_costo1;
    private javax.swing.JCheckBox jcbx_historialeti;
    private javax.swing.JCheckBox jcbx_historialne;
    private javax.swing.JComboBox jcbx_tiendas;
    private javax.swing.JComboBox jcbx_viajes;
    private javax.swing.JCheckBox jchbx_verexistencias;
    private javax.swing.JEditorPane jep_articuloimagen;
    private javax.swing.JEditorPane jep_articuloimagen1;
    private javax.swing.JEditorPane jepn_fotos;
    private javax.swing.JLabel jlbl_cantidadregistros;
    private javax.swing.JLabel jlbl_cantidadregistros1;
    private javax.swing.JLabel jlbl_paginas;
    private javax.swing.JLabel jlbl_textobuscado;
    private javax.swing.JList jlst_clientesdistribucion2;
    private javax.swing.JList jlst_clientesdistribucion3;
    private javax.swing.JList jlst_clientesdistribucion4;
    private javax.swing.JMenuItem jmn_help;
    private javax.swing.JMenuItem jmni_altadefectuoso;
    private javax.swing.JMenuItem jmni_altareclasif;
    private javax.swing.JMenuItem jmni_creacomentario;
    private javax.swing.JMenuItem jmni_escape;
    private javax.swing.JMenuItem jmni_importar;
    private javax.swing.JMenuItem jmni_menu;
    private javax.swing.JMenuItem jmni_revpro;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JMenuItem jmni_tenersuerte;
    private javax.swing.JRadioButton jrb_bclave;
    private javax.swing.JRadioButton jrb_bdescrip;
    private javax.swing.JRadioButton jrb_bdessubfam;
    private javax.swing.JRadioButton jrb_bidfam;
    private javax.swing.JRadioButton jrb_bidsubfam;
    private javax.swing.JRadioButton jrb_bitem;
    private javax.swing.JRadioButton jrb_bprecio;
    private javax.swing.JRadioButton jrb_linea;
    private javax.swing.JRadioButton jrb_obaniway;
    private javax.swing.JRadioButton jrb_obcomienza;
    private javax.swing.JRadioButton jrb_obexacto;
    private javax.swing.JRadioButton jrbtn_evgen;
    private javax.swing.JRadioButton jrbtn_existencia;
    private javax.swing.JRadioButton jrbtn_idarticulo;
    private javax.swing.JRadioButton jrbtn_modoactualizacion;
    private javax.swing.JRadioButton jrbtn_modoactualizacion1;
    private javax.swing.JTable jt_catempleados1;
    private javax.swing.JTextArea jta_archivo;
    private javax.swing.JTable jtb_catalogo_articulos;
    private javax.swing.JTable jtb_catalogo_articulos1;
    private javax.swing.JTable jtb_catalogo_articulos2;
    private javax.swing.JTable jtb_catalogo_articulos3;
    private javax.swing.JTable jtb_catalogo_artiexis;
    private javax.swing.JButton jtb_inveprogramados;
    private javax.swing.JTable jtbl_articulosentiendas1;
    private javax.swing.JTextField jtf_busqueda;
    private javax.swing.JTextField jtf_cantidadeti;
    private javax.swing.JTextField jtf_fotosartxpag;
    private javax.swing.JTextField jtf_idarticulo_exi;
    private javax.swing.JTextField jtf_idarticulo_exi1;
    private javax.swing.JTextField jtf_idarticulo_exi2;
    private javax.swing.JTextField jtf_idarticulocat;
    private javax.swing.JTextField jtf_idartsug;
    private javax.swing.JTextField jtf_idproductopromo;
    private javax.swing.JTextField jtf_paginaactual;
    private javax.swing.JTextField jtf_preciobodega;
    private javax.swing.JTextField jtf_preciotienda;
    private javax.swing.JTextField jtf_tiendaarti1;
    private javax.swing.JTextField jtf_tiendaarti2;
    private javax.swing.JTextField jtf_unidad;
    // End of variables declaration//GEN-END:variables

}
